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 CALj2ACXJCmtJjNm8KCAmXAA_yrtPaa-ot4GJg0UiyAcaE9jJdA@mail.gmail.com
Whole thread Raw
In response to Re: pg_recvlogical prints bogus error when interrupted  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: pg_recvlogical prints bogus error when interrupted
List pgsql-hackers
On Wed, Jul 19, 2023 at 12:07 PM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
>
> 4. With v5, it was taking a while to exit after the first CTRL+C, see
> multiple CTRL+Cs at the end:
> ubuntu::~/postgres/inst/bin$ ./pg_recvlogical --slot=lsub1_repl_slot
> --file=lsub1.data --start --verbose
> pg_recvlogical: starting log streaming at 0/0 (slot lsub1_repl_slot)
> pg_recvlogical: streaming initiated
> pg_recvlogical: confirming write up to 0/0, flush to 0/0 (slot lsub1_repl_slot)
> pg_recvlogical: confirming write up to 0/2BFFFD0, flush to 0/2BFFFD0
> (slot lsub1_repl_slot)
> pg_recvlogical: confirming write up to 0/2BFFFD0, flush to 0/2BFFFD0
> (slot lsub1_repl_slot)
> pg_recvlogical: confirming write up to 0/2BFFFD0, flush to 0/2BFFFD0
> (slot lsub1_repl_slot)
> ^Cpg_recvlogical: end position 0/2867D70 reached on signal
> ^C^C^C^C^C^C^C^C^C^C^C^C
> ^C^C^C^C^C^C^C^C^C^C^C^C

I think the delay is expected for the reason specified below and is
not because of any of the changes in v5. As far as CTRL+C is
concerned, it is a clean exit and hence we can't escape the while(1)
loop.

/*
         * We're doing a client-initiated clean exit and have sent CopyDone to
         * the server. Drain any messages, so we don't miss a last-minute
         * ErrorResponse. The walsender stops generating XLogData records once
         * it sees CopyDone, so expect this to finish quickly. After CopyDone,
         * it's too late for sendFeedback(), even if this were to take a long
         * time. Hence, use synchronous-mode PQgetCopyData().
         */
        while (1)
        {

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



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Adding argument names to aggregate functions
Next
From: Önder Kalacı
Date:
Subject: Re: doc: improve the restriction description of using indexes on REPLICA IDENTITY FULL table.