Re: walsender bug: stuck during shutdown

2020-12-04 Thread Alvaro Herrera
On 2020-Nov-26, Fujii Masao wrote: > Yes, so the problem here is that walsender goes into the busy loop > in that case. Seems this happens only in logical replication walsender. > In physical replication walsender, WaitLatchOrSocket() in WalSndLoop() > seems to work as expected and prevent it

Re: walsender bug: stuck during shutdown

2020-11-25 Thread Fujii Masao
On 2020/11/26 11:45, Alvaro Herrera wrote: On 2020-Nov-26, Fujii Masao wrote: On the second thought, walsender doesn't wait forever unless wal_sender_timeout is disabled, even in the case in discussion? Or if there is the case where wal_sender_timeout doesn't work expectedly, we might need

Re: walsender bug: stuck during shutdown

2020-11-25 Thread Alvaro Herrera
On 2020-Nov-26, Fujii Masao wrote: > On the second thought, walsender doesn't wait forever unless > wal_sender_timeout is disabled, even in the case in discussion? > Or if there is the case where wal_sender_timeout doesn't work expectedly, > we might need to fix that at first. Hmm, no, it

Re: walsender bug: stuck during shutdown

2020-11-25 Thread Fujii Masao
On 2020/11/26 3:45, Alvaro Herrera wrote: On 2020-Nov-25, Fujii Masao wrote: But whether MyWalSnd->write is InvalidRecPtr or not, if it's behind sentPtr, walsender should keep waiting for the ack to all the sent message to be replied, i.e., isn't this expected behavior of normal shutdown?

Re: walsender bug: stuck during shutdown

2020-11-25 Thread Alvaro Herrera
On 2020-Nov-25, Fujii Masao wrote: > But whether MyWalSnd->write is InvalidRecPtr or not, if it's behind sentPtr, > walsender should keep waiting for the ack to all the sent message to be > replied, i.e., isn't this expected behavior of normal shutdown? That is, > if we want to shutdown

Re: walsender bug: stuck during shutdown

2020-11-24 Thread Fujii Masao
On 2020/11/25 0:07, Alvaro Herrera wrote: Hello, On 2020-Nov-24, Fujii Masao wrote: Thanks for working on this! Could you tell me the discussion thread where Chloe Dives reported the issue to? Sorry I could not find that.. It was not public -- sorry I didn't make that clear. I'd like

Re: walsender bug: stuck during shutdown

2020-11-24 Thread Alvaro Herrera
Hello, On 2020-Nov-24, Fujii Masao wrote: > Thanks for working on this! > Could you tell me the discussion thread where Chloe Dives reported the issue > to? > Sorry I could not find that.. It was not public -- sorry I didn't make that clear. > I'd like to see the procedure to reproduce the

Re: walsender bug: stuck during shutdown

2020-11-23 Thread Fujii Masao
On 2020/11/24 5:52, Alvaro Herrera wrote: Hello Chloe Dives reported that sometimes a walsender would become stuck during shutdown and *not* shutdown, thus preventing postmaster from completing the shutdown cycle. This has been observed to cause the servers to remain in such state for

walsender bug: stuck during shutdown

2020-11-23 Thread Alvaro Herrera
Hello Chloe Dives reported that sometimes a walsender would become stuck during shutdown and *not* shutdown, thus preventing postmaster from completing the shutdown cycle. This has been observed to cause the servers to remain in such state for several hours. After a lengthy investigation and