From 959da25d6e77d463c145f3b9a37f3eac6e58e663 Mon Sep 17 00:00:00 2001 From: Aleksandr Korchak Date: Thu, 19 Nov 2026 15:07:07 +0000 Subject: [PATCH 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 09240d2..575572c 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -622,6 +622,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