Re: [PATCH] Check interrupts while draining received WAL

From: Nitin Jadhav <nitinjadhavpostgres(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Check interrupts while draining received WAL
Date: 2026-11-18 06:53:30
Message-ID: CAMm1aWaRH6LfZ+KvfD1DpSdOGefLLEnoiC27Dh1kb1bZ=fT-rw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Fujii-San, Joao,

Thank you both for the review, and Joao for the detailed testing.

> Thanks for the patch! It looks good to me.
>
> We should backpatch it to all supported versions? If so, for v17 and older,
> ProcessWalRcvInterrupts() should be called instead of CHECK_FOR_INTERRUPTS()?

Yes, I agree that this should be backpatched to all supported branches.

For v17 and older, ProcessWalRcvInterrupts() is the appropriate check.
Besides calling CHECK_FOR_INTERRUPTS(), it also handles the receiver’s
shutdown flag, so CHECK_FOR_INTERRUPTS() alone would not be
sufficient.

From v18 onward, the WAL receiver uses the standard die() SIGTERM
handler, which sets InterruptPending and ProcDiePending. Termination
is therefore handled through the normal interrupt machinery, making
CHECK_FOR_INTERRUPTS() sufficient.

Best Regards,
Nitin Jadhav
Microsoft

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2026-11-18 07:00:28 Re: Validate GIN posting lists before decoding them
Previous Message Hayato Kuroda (Fujitsu) 2026-11-18 06:51:48 RE: Allow pg_read_all_stats to read replication origin status