| From: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
|---|---|
| To: | Aleksandr Korchak <korchakan(at)gmail(dot)com> |
| Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org, andres(at)anarazel(dot)de |
| Subject: | Re: PANIC at shutdown when a reload changes full_page_writes |
| Date: | 2026-11-25 17:01:40 |
| Message-ID: | awcUdIxNSFl4AjgN@nathan |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Nov 25, 2026 at 05:53:13PM +0200, Aleksandr Korchak wrote:
> Since 87a6690cc69 ("Change shutdown sequence to terminate checkpointer
> last", 18) the checkpointer doesn't exit after ShutdownXLOG(), but
> waits for SIGUSR2 in a loop that calls ProcessCheckpointerInterrupts().
> A SIGHUP that arrived during the shutdown checkpoint, or later (during
> a smart shutdown the postmaster keeps forwarding it), is processed
> there. If it changes full_page_writes, UpdateFullPageWrites() tries to
> insert XLOG_FPW_CHANGE after CreateCheckPoint() has set
> LocalXLogInsertAllowed = 0, inside a critical section, and the
> shutdown ends in a PANIC.
>
> [...]
>
> The shutdown checkpoint is already written, so pg_controldata says
> "shut down" and the next start doesn't need recovery, but the server
> still goes down with a PANIC instead of a clean shutdown. Reproduced
> with the commands above on master, and on REL_19_STABLE and
> REL_18_STABLE with gdb holding the checkpointer in the shutdown
> checkpoint.
It sounds like even if this scenario did occur in practice (which seems
highly unlikely), the only bad effect is the exit code. If that
characterization is true, I'm not sure we need to worry about fixing it.
IMO we have bigger fish to fry.
--
nathan
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Eisentraut | 2026-11-25 17:04:23 | pg_rewind: Fix buffer size passed when building WAL file name |
| Previous Message | Srinath Reddy Sadipiralla | 2026-11-25 16:58:31 | Re: Fix FATAL error when using recovery_target = 'immediate' on cleanly shut down clusters |