From 6031cc966842dc5222e45896bf23638f00d7f23b Mon Sep 17 00:00:00 2001 From: Aleksandr Korchak Date: Thu, 19 Nov 2026 15:07:44 +0000 Subject: [PATCH REL_19 v1] Ignore SIGHUP in checkpointer after the shutdown checkpoint Since commit 87a6690cc69, the checkpointer does not exit right after writing the shutdown checkpoint, but waits for the postmaster in a loop that calls ProcessCheckpointerInterrupts(). A config reload that arrives during or after the shutdown checkpoint, e.g. "pg_ctl reload" during a smart shutdown, is processed there. If it changes full_page_writes, UpdateFullPageWrites() tries to write XLOG_FPW_CHANGE after WAL insertion has been disallowed, inside a critical section, which ends in "PANIC: cannot make new WAL entries during recovery". The shutdown checkpoint has already been written at that point, so the next start does not need recovery, but the server still goes down with a PANIC instead of a clean shutdown. There is nothing left to apply once the shutdown checkpoint has been written, so ignore SIGHUP from then on and drop a pending reload. Author: Aleksandr Korchak Backpatch-through: 18 --- src/backend/postmaster/checkpointer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index 5fd9576..4cfdaf6 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -632,6 +632,9 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len) pgstat_report_checkpointer(); pgstat_report_wal(true); + pqsignal(SIGHUP, PG_SIG_IGN); + ConfigReloadPending = false; + /* * Tell postmaster that we're done. */ -- 2.55.0