Re: Exit walsender before confirming remote flush in logical replication

From: Andrey Silitskiy <a(dot)silitskiy(at)postgrespro(dot)ru>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Alexander Korotkov <aekorotkov(at)gmail(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>, Greg Sabino Mullane <htamfids(at)gmail(dot)com>, Japin Li <japinli(at)hotmail(dot)com>
Subject: Re: Exit walsender before confirming remote flush in logical replication
Date: 2026-03-13 12:14:07
Message-ID: f19a6c97-d279-49f9-aab4-fe0d4ccd97f2@postgrespro.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 13 Mar 2026 Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> With the patch, when I set wal_sender_shutdown_timeout to 1ms and
> wal_sender_timeout to 1min, it still took about 26s for walsender to shut
> down due to wal_sender_shutdown_timeout expiration.

Thanks!.

I also reproduced this delay in case of full output buffers. It has already
been fixed in the latest patch.
I think in your case, the 26-second wait was due to walsender falling asleep
at wal_sender_timeout / 2 seconds after receiving the shutdown request.
The issue should have been fixed in the patch (see WalSndComputeSleeptime).

Regards,
Andrey Silitskiy

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2026-03-13 12:16:49 Re: Import Statistics in postgres_fdw before resorting to sampling.
Previous Message Andrey Silitskiy 2026-03-13 12:00:40 Re: Exit walsender before confirming remote flush in logical replication