Hello,

At Fri, 21 Apr 2017 10:15:20 -0400, Peter Eisentraut 
<peter.eisentr...@2ndquadrant.com> wrote in 
<77f75a90-a495-6661-68df-e4993bfac...@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 is
 enabled 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



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to