Re: pg_recvlogical prints bogus error when interrupted

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tristan Partin <tristan(at)neon(dot)tech>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, andres(at)anarazel(dot)de, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_recvlogical prints bogus error when interrupted
Date: 2023-07-19 02:34:19
Message-ID: ZLdLHVh/jIBmaXq1@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 10, 2023 at 01:44:45PM +0900, Michael Paquier wrote:
> As StreamLogicalLog() states once it leaves its main loop because
> time_to_abort has been switched to true, we want a clean exit. I
> think that this patch is just a more complicated way to avoid doing
> twice the operations done by prepareToTerminate(). So how about
> moving the prepareToTerminate() call outside the main streaming loop
> and call it when time_to_abort is true? Then, I would suggest to
> change the keepalive argument of prepareToTerminate() to an enum able
> to handle three values to log the reason why the tool is stopping: the
> end of WAL, an interruption or a keepalive when logging. There are
> two of them now, but we want a third mode for the signals.

It took me some time to come back to this one, but attached is what I
had in mind. This stuff has three reasons to stop: keepalive, end LSN
or signal. This makes the code easier to follow.

Thoughts or comments?
--
Michael

Attachment Content-Type Size
v5-0001-Fix-pg_recvlogical-error-message-upon-SIGINT-SIGT.patch text/x-diff 4.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message mao zhang 2023-07-19 02:39:44 FATAL: operator class "xxxx" does not exist for access method "btree"
Previous Message Thomas Munro 2023-07-19 01:26:30 Re: Extension Enhancement: Buffer Invalidation in pg_buffercache