Re: Exit walsender before confirming remote flush in logical replication

From: Andrey Silitskiy <a(dot)silitskiy(at)postgrespro(dot)ru>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: 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>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Subject: Re: Exit walsender before confirming remote flush in logical replication
Date: 2026-03-13 12:00:40
Message-ID: 51dee26a-45ee-4313-8603-83d2c4b97488@postgrespro.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for the review! Fixed patch is attached.

On Wed, 11 Mar 2026 Greg Sabino Mullane <htamfids(at)gmail(dot)com> wrote:
> I'm not really clear on this - wouldn't we want this only for
got_SIGUSR2?

Сhecking got_SIGUSR2 alone is not enough. If we received got_STOPPING,
got_SIGUSR2 will be set only if WalSndCaughtUp is true. This may fail,
and then the test hangs with the inability to terminate walsender.

> Tests:
> * Should test something other than -1 and 0 (e.g. a positive value)

I'm not sure if it's worth adding a test containing a long timeout wait.
I can add a test-case with a small positive parameter value (for example,
200ms). However, I don't think it will be possible to verify the time period
for which the walsender was actually terminated. Still, it will be
limited to
checking the fact of termination. What do you think?

Regards,
Andrey Silitskiy

Attachment Content-Type Size
v4-0001-Introduce-a-new-wal_sender_shutdown_timeout-GUC.patch text/x-patch 19.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Silitskiy 2026-03-13 12:14:07 Re: Exit walsender before confirming remote flush in logical replication
Previous Message Nazir Bilal Yavuz 2026-03-13 11:57:48 Re: Speed up COPY FROM text/CSV parsing using SIMD