Re: Network failure may prevent promotion - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Network failure may prevent promotion
Date
Msg-id CAHGQGwHodkBpmB0_228-+k9yn=HL9ReNRWzWez+nQTnoLObnJw@mail.gmail.com
Whole thread Raw
In response to Re: Network failure may prevent promotion  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Network failure may prevent promotion
List pgsql-hackers
On Tue, Jan 23, 2024 at 6:43 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> There's an existing AmWalReceiverProcess() macro too. Let's use that.

+1

> Hmm, but doesn't bgworker_die() have that problem with exit(1)ing in the
> signal handler?

Yes, that's a problem. This issue was raised sometimes so far,
but has not been resolved yet.

> I also wonder if we should replace SignalHandlerForShutdownRequest()
> completely with die(), in all processes? The difference is that
> SignalHandlerForShutdownRequest() uses ShutdownRequestPending, while
> die() uses ProcDiePending && InterruptPending to indicate that the
> signal was received. Or do some of the processes want to check for
> ShutdownRequestPending only at specific places, and don't want to get
> terminated at the any random CHECK_FOR_INTERRUPTS()?

For example, checkpointer seems to want to handle a shutdown request
only when no other checkpoint is in progress because initiating a shutdown
checkpoint while another checkpoint is running could lead to issues.

Also I just wonder if even walreceiver can exit safely at any random
CHECK_FOR_INTERRUPTS()...

Regards,

--
Fujii Masao



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: s_lock_test no longer works
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: speed up a logical replica setup