Re: Exit walsender before confirming remote flush in logical replication

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Andrey Silitskiy <a(dot)silitskiy(at)postgrespro(dot)ru>, Greg Sabino Mullane <htamfids(at)gmail(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, Ronan Dunklau <ronan(at)dunklau(dot)fr>, Vitaly Davydov <v(dot)davydov(at)postgrespro(dot)ru>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, "Takamichi Osumi (Fujitsu)" <osumi(dot)takamichi(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "sawada(dot)mshk(at)gmail(dot)com" <sawada(dot)mshk(at)gmail(dot)com>, "michael(at)paquier(dot)xyz" <michael(at)paquier(dot)xyz>, "peter(dot)eisentraut(at)enterprisedb(dot)com" <peter(dot)eisentraut(at)enterprisedb(dot)com>, "dilipbalaut(at)gmail(dot)com" <dilipbalaut(at)gmail(dot)com>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, "amit(dot)kapila16(at)gmail(dot)com" <amit(dot)kapila16(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>
Subject: Re: Exit walsender before confirming remote flush in logical replication
Date: 2026-03-29 12:34:06
Message-ID: CAPpHfdvzwRo8chZax1_qscfuQJer5r8oQpYDqOURbP9uHTZrsQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Fujii!

On Wed, Mar 25, 2026 at 2:39 PM Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> In my tests, the shutdown in step #6 got stuck.
>
> Any thoughts on whether this indicates a problem in the patch or
> something off in my setup?

I tried your test case, but I didn't stuck for me while using v5 patch
from Andrey [1].

One possible idea why hand may happen for is is that
WalSndWaitForWal() has missing WalSndCheckShutdownTimeout() call. See
the patch attached. Could I ask you, to retry with this patch applied
on top of v5 patch by Andrey [1]. And also, if possible, turn your
test into a perl tap test inside 038_walsnd_shutdown_timeout.pl.

Thank you.

Links
1. https://www.postgresql.org/message-id/aed6b990-e7d8-40d1-96a4-64ccbfbda876%40postgrespro.ru

------
Regards,
Alexander Korotkov
Supabase

Attachment Content-Type Size
WalSndWaitForWal_WalSndCheckShutdownTimeout.patch application/octet-stream 880 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2026-03-29 13:16:16 Re: astreamer fixes
Previous Message Daniil Davydov 2026-03-29 12:26:11 Get rid of redundant StringInfo accumulation