Re: pg_recvlogical prints bogus error when interrupted - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: pg_recvlogical prints bogus error when interrupted
Date
Msg-id CALj2ACWgqdUiwEY7o85V9Meb21Qa+Y8qxPprT82-ok8WhXArUw@mail.gmail.com
Whole thread Raw
In response to Re: pg_recvlogical prints bogus error when interrupted  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pg_recvlogical prints bogus error when interrupted  (Michael Paquier <michael@paquier.xyz>)
Re: pg_recvlogical prints bogus error when interrupted  ("Tristan Partin" <tristan@neon.tech>)
List pgsql-hackers
On Tue, Apr 11, 2023 at 11:42 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Mon, Oct 24, 2022 at 08:15:11AM +0530, Bharath Rupireddy wrote:
> > The attached patch (pg_recvlogical_graceful_interrupt.text) has a
> > couple of problems, I believe. We're losing prepareToTerminate() with
> > keepalive true and we're not skipping pg_log_error("unexpected
> > termination of replication stream: %s" upon interrupt, after all we're
> > here discussing how to avoid it.
> >
> > I came up with the attached v2 patch, please have a look.
>
> This thread has slipped through the feature freeze deadline.  Would
> people be OK to do something now on HEAD?  A backpatch is also in
> order, IMO, as the current behavior looks confusing under SIGINT and
> SIGTERM.

IMO, +1 for HEAD/PG16 and +0.5 for backpatching as it may not be so
critical to backpatch all the way down. What may happen without this
patch is that the output file isn't fsync-ed upon SIGINT/SIGTERM.
Well, is it a critical issue on production servers?

On Fri, Apr 7, 2023 at 5:12 AM Cary Huang <cary.huang@highgo.ca> wrote:
>
> The following review has been posted through the commitfest application:
>
> The patch applies and tests fine. I like the way to have both ready_to_exit and time_to_abort variables to control
theexit sequence. I think the (void) cast can be removed in front of PQputCopyEnd(), PQflush for consistency purposes
asit does not give warnings and everywhere else does not have those casts. 

Thanks for reviewing. I removed the (void) casts like elsewhere in the
code, however, I didn't change such casts in prepareToTerminate() to
not create a diff.

I'm attaching the v4 patch for further review.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: psql: show current user in prompt
Next
From: Michael Paquier
Date:
Subject: Re: Autogenerate some wait events code and documentation