Re: Exit walsender before confirming remote flush in logical replication

Andrey Silitskiy <a.silitskiy@postgrespro.ru>

From: Andrey Silitskiy <a.silitskiy@postgrespro.ru>
To: Alexander Korotkov <aekorotkov@gmail.com>, Fujii Masao <masao.fujii@gmail.com>
Cc: Greg Sabino Mullane <htamfids@gmail.com>, 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>
Date: 2026-03-30T17:31:04Z
Lists: pgsql-hackers

Attachments

On Mar 30, 2026 Andrey Silitskiy
<a(dot)silitskiy(at)postgrespro(dot)ru>wrote:
 > It is worth noting that in this configuration, the second walsender may
 > terminate due to inactive slot before the wal_sender_shutdown_timeout
 > terminates the process, ...

Updated. In this configuration, in some situations walsender processes
may already have been terminated by the time of fast shutdown.
And in this case, the fast shutdown will be successful, but it will not
be the reason for walsender termination and the logs will be different.
Decided to leave the new shutdown test case, but not check the logs in it.

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.