Re: Race condition in FetchTableStates() breaks synchronization of subscription tables

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Race condition in FetchTableStates() breaks synchronization of subscription tables
Дата
Msg-id CAA4eK1JMDsVzu33d2Q8hWDTd8ZjqSbrcNU5ur3reKfOxhSb9MA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Race condition in FetchTableStates() breaks synchronization of subscription tables  (vignesh C <vignesh21@gmail.com>)
Ответы Re: Race condition in FetchTableStates() breaks synchronization of subscription tables  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On Wed, Mar 13, 2024 at 11:59 AM vignesh C <vignesh21@gmail.com> wrote:
>
> On Wed, 13 Mar 2024 at 10:12, Zhijie Hou (Fujitsu)
> <houzj.fnst@fujitsu.com> wrote:
> >
> >
> > For 0002, instead of avoid resetting the latch, is it possible to let the
> > logical rep worker wake up the launcher once after attaching ?
>
> Waking up of the launch process uses the same latch that is used for
> subscription creation/modification and apply worker process exit. As
> the handling of this latch for subscription creation/modification and
> worker process exit can be done only by ApplyLauncherMain, we will not
> be able to reset the latch in WaitForReplicationWorkerAttach. I feel
> waking up the launcher process might not help in this case as
> currently we will not be able to differentiate between worker
> attached, subscription creation/modification and apply worker process
> exit.
>

IIUC, even if we set the latch once the worker attaches, the other
set_latch by subscription creation/modification or apply_worker_exit
could also be consumed due to reset of latch in
WaitForReplicationWorkerAttach(). Is that understanding correct? If
so, can we use some other way to wake up
WaitForReplicationWorkerAttach() say condition variable? The current
proposal can fix the issue but looks bit adhoc.

--
With Regards,
Amit Kapila.



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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Minor document typo
Следующее
От: David Rowley
Дата:
Сообщение: Re: Minor document typo