Re: Deadlock between logrep apply worker and tablesync worker

Поиск
Список
Период
Сортировка
Искать
От
Amit Kapila
Тема
Re: Deadlock between logrep apply worker and tablesync worker
Дата
Msg-id
CAA4eK1JjJWhsSLcyAATV7Fu5GnYFHhNmH=+4y5HqR5vzzbyAUg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Deadlock between logrep apply worker and tablesync worker Tom Lane <tgl@sss.pgh.pa.us>
Re: Deadlock between logrep apply worker and tablesync worker Amit Kapila <amit.kapila16@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker vignesh C <vignesh21@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker Amit Kapila <amit.kapila16@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker vignesh C <vignesh21@gmail.com>
RE: Deadlock between logrep apply worker and tablesync worker "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
Re: Deadlock between logrep apply worker and tablesync worker Amit Kapila <amit.kapila16@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker vignesh C <vignesh21@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker Amit Kapila <amit.kapila16@gmail.com>
RE: Deadlock between logrep apply worker and tablesync worker "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
Re: Deadlock between logrep apply worker and tablesync worker vignesh C <vignesh21@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker vignesh C <vignesh21@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker vignesh C <vignesh21@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker vignesh C <vignesh21@gmail.com>
RE: Deadlock between logrep apply worker and tablesync worker "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
Re: Deadlock between logrep apply worker and tablesync worker Amit Kapila <amit.kapila16@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker Amit Kapila <amit.kapila16@gmail.com>
RE: Deadlock between logrep apply worker and tablesync worker "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
Re: Deadlock between logrep apply worker and tablesync worker Peter Smith <smithpb2250@gmail.com>
RE: Deadlock between logrep apply worker and tablesync worker "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
Re: Deadlock between logrep apply worker and tablesync worker Peter Smith <smithpb2250@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker Peter Smith <smithpb2250@gmail.com>
Re: Deadlock between logrep apply worker and tablesync worker Amit Kapila <amit.kapila16@gmail.com>
On Fri, Jan 27, 2023 at 3:45 PM vignesh C  wrote:
>
> On Mon, 23 Jan 2023 at 10:52, Amit Kapila  wrote:
> >
> > IIRC, this is done to prevent concurrent drops of origin drop say by
> > exposed API pg_replication_origin_drop(). See the discussion in [1]
> > related to it. If we want we can optimize it so that we can acquire
> > the lock on the specific origin as mentioned in comments
> > replorigin_drop_by_name() but it was not clear that this operation
> > would be frequent enough.
>
> Here is an attached patch to lock the replication origin record using
> LockSharedObject instead of locking pg_replication_origin relation in
> ExclusiveLock mode. Now tablesync worker will wait only if the
> tablesync worker is trying to drop the same replication origin which
> has already been dropped by the apply worker, the other tablesync
> workers will be able to successfully drop the replication origin
> without any wait.
>

There is a code in the function replorigin_drop_guts() that uses the
functionality introduced by replorigin_exists(). Can we reuse this
function for the same?

Also, it would be good if you can share the numbers for different runs
of "src/test/subscription/t/002_types.pl" before and after the patch.

-- 
With Regards,
Amit Kapila.


В списке pgsql-hackers по дате отправления
От: Drouvot, Bertrand
Дата:
От: Nitin Jadhav
Дата:
FAQ