Re: undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION
Дата
Msg-id CAA4eK1L4wWiFnhDYhGMv-M4GTR6Xg13xoaSjhUm+YzFaP3nxUQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Ответы Re: undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION
Список pgsql-hackers
On Wed, Nov 22, 2023 at 4:51 PM Tomas Vondra
<tomas.vondra@enterprisedb.com> wrote:
>
> On 11/22/23 11:38, Amit Kapila wrote:
> >
> > Okay. IIUC, what's going on here is that the apply worker acquires
> > AccessShareLock on pg_subscription to update rel state for one of the
> > tables say tbl-1, and then for another table say tbl-2, it started
> > waiting for a state change via wait_for_relation_state_change(). I
> > think here the fix is to commit the transaction before we go for a
> > wait. I guess we need something along the lines of what is proposed in
> > [1] though we have solved the problem in that thread in some other
> > way..
> >
>
> Possibly. I haven't checked if the commit might have some unexpected
> consequences, but I can confirm I can no longer reproduce the deadlock
> with the patch applied.
>

Thanks for the verification. Offhand, I don't see any problem with
doing a commit at that place but will try to think some more about it.
I think we may want to call pgstat_report_stat(false) after commit to
avoid a long delay in stats.

I haven't verified but I think this will be a problem in back-branches as well.

--
With Regards,
Amit Kapila.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrei Lepikhov
Дата:
Сообщение: Re: POC, WIP: OR-clause support for indexes
Следующее
От: Xiang Gao
Дата:
Сообщение: RE: Question about the Implementation of vector32_is_highbit_set on ARM