Re: Exit walsender before confirming remote flush in logical replication

Alexander Korotkov <aekorotkov@gmail.com>

From: Alexander Korotkov <aekorotkov@gmail.com>
To: Andrey Silitskiy <a.silitskiy@postgrespro.ru>
Cc: Japin Li <japinli@hotmail.com>, Ronan Dunklau <ronan@dunklau.fr>, Vitaly Davydov <v.davydov@postgrespro.ru>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, "Takamichi Osumi (Fujitsu)" <osumi.takamichi@fujitsu.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "sawada.mshk@gmail.com" <sawada.mshk@gmail.com>, "michael@paquier.xyz" <michael@paquier.xyz>, "peter.eisentraut@enterprisedb.com" <peter.eisentraut@enterprisedb.com>, "dilipbalaut@gmail.com" <dilipbalaut@gmail.com>, "andres@anarazel.de" <andres@anarazel.de>, "amit.kapila16@gmail.com" <amit.kapila16@gmail.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, Peter Smith <smithpb2250@gmail.com>, Greg Sabino Mullane <htamfids@gmail.com>, Fujii Masao <masao.fujii@gmail.com>
Date: 2026-03-11T14:24:05Z
Lists: pgsql-hackers

Attachments

Hi!

On Wed, Mar 4, 2026 at 10:47 AM Andrey Silitskiy
<a.silitskiy@postgrespro.ru> wrote:
> On Wed, 03 Mar 2026 Japin Li <japinli(at)hotmail(dot)com> wrote:
>  > At first glance, wal_sender_shutdown_timeout seems to have the wrong
>  > type.
>
> Fixed.

I've revised this patch fixing grammar in commit message, comments and
documentation.

I think the current patch addresses all the main concerns raised in
the thread.  The patch doesn't unconditionally change the behavior: it
introduces a new GUC, which could be set on per-connection basis, and
also affects physical WAL senders.  The GUC specifies timeout, which
gives user a flexibility.  The default value of the GUC is -1
(disabled).  So, no behavior change by default.  Also, it doesn't
require replication protocol change.  New WalSndDoneImmediate() sends
done message to the receiver just like WalSndDone().  So, existing
clients should be OK.

I'm going to push this if no objections.

------
Regards,
Alexander Korotkov
Supabase

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Avoid blocking indefinitely while finishing walsender shutdown

  2. Add wal_sender_shutdown_timeout GUC to limit shutdown wait for replication

  3. pg_upgrade: Add --copy option

  4. Prevent possibility of panics during shutdown checkpoint.

  5. Support clean switchover.