Re: Exit walsender before confirming remote flush in logical replication - Mailing list pgsql-hackers

From Andrey Silitskiy
Subject Re: Exit walsender before confirming remote flush in logical replication
Date
Msg-id 51dee26a-45ee-4313-8603-83d2c4b97488@postgrespro.ru
Whole thread Raw
In response to Re: Exit walsender before confirming remote flush in logical replication  (Greg Sabino Mullane <htamfids@gmail.com>)
Responses Re: Exit walsender before confirming remote flush in logical replication
List 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

pgsql-hackers by date:

Previous
From: Nazir Bilal Yavuz
Date:
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD
Next
From: Andrey Silitskiy
Date:
Subject: Re: Exit walsender before confirming remote flush in logical replication