Re: Exit walsender before confirming remote flush in logical replication
| От | Chao Li |
|---|---|
| Тема | Re: Exit walsender before confirming remote flush in logical replication |
| Дата | |
| Msg-id | 997E77BA-DF0A-470B-9F9E-64A8A02C95D9@gmail.com обсуждение |
| Ответ на | Re: Exit walsender before confirming remote flush in logical replication (Fujii Masao <masao.fujii@gmail.com>) |
| Ответы |
Re: Exit walsender before confirming remote flush in logical replication
|
| Список | pgsql-hackers |
> On Apr 24, 2026, at 18:29, Fujii Masao <masao.fujii@gmail.com> wrote: > > On Fri, Apr 24, 2026 at 11:05 AM Chao Li <li.evan.chao@gmail.com> wrote: >> ProcessPendingWrites() calls ProcessRepliesIfAny() in the first place, so if it is possible that, a new COPY message isappended after the already-queued CommandComplete? Which seems to violate the protocol, but I am not sure if that wouldlead to any trouble. >> >> So, maybe we need a new helper, say ProcessPendingWritesForShutdown(), that loops while pq_is_send_pending(), call WalSndCheckShutdownTimeout()and only wait for WL_SOCKET_WRITEABLE, then pq_flush_if_writable(), on flush failure, maybe WalSndShutdown(). > > Thanks for the review! You're right. > > I added such loop directly in WalSndDone() instead of introducing a new helper > function, since only WalSndDone() needs it and the extra loop does not make > WalSndDone() significantly more complicated. > > I've attached an updated patch. > > Regards, > > -- > Fujii Masao > <v2-0001-Avoid-blocking-indefinitely-while-finishing-walse.patch> Thanks for updating the patch. V2 looks good to me. “Make check-world” also passed from my side on MacOS. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/
В списке pgsql-hackers по дате отправления: