Re: [HACKERS] subscription worker doesn't start immediately oneabled

Поиск
Список
Период
Сортировка
От Kyotaro HORIGUCHI
Тема Re: [HACKERS] subscription worker doesn't start immediately oneabled
Дата
Msg-id 20170424.183711.55064031.horiguchi.kyotaro@lab.ntt.co.jp
обсуждение исходный текст
Ответ на Re: [HACKERS] subscription worker doesn't start immediately on eabled  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
Hello,

At Fri, 21 Apr 2017 10:15:20 -0400, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote in
<77f75a90-a495-6661-68df-e4993bfac3e3@2ndquadrant.com>
> On 4/6/17 08:24, Kyotaro HORIGUCHI wrote:
> > Hello. I found dubious behavior while playing with logical
> > replication.
> > 
> > When we disable a subscription, replication worker immediately stops.
> > 
> > =# ALTER SUBSCRIPTION s1 DISABLE;
> > 
> > On the other hand even if we enable a subscription, worker
> > doesn't start immediately. It takes 3 minutes in the worst
> > case. (DEFAULT_NAPTIME_PER_CYCLE)
> > 
> > The attached patch wakes up launcher when a subscription is
> > enabled. This fails when a subscription is enabled immedaitely
> > after disabling but it won't be a matter.
> 
> What do you mean by "this fails"?

Mmm. Is the sentsnce below makes sense?

"What the patch is doing doesn't work" when a subscription isenabled immedaitely after disabling but it won't be a
matter.

Or,

It takes a short but not-zero time to shutdown a worker by
updating subenabled to false.  On enablling subenabled just
after, AlterSubScription tells the backend to notify the launcher
of the update of pg_subscription on commit. But if the launcher
has not been notified that the worker is terminated, the
notification is ignored and sleep for a certain interval. (I
haven't confirmed whether it is 180s or 5s, though.)


regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center




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

Предыдущее
От: Rahila Syed
Дата:
Сообщение: Re: [HACKERS] Adding support for Default partition in partitioning
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: [HACKERS] Cached plans and statement generalization