model-writtenrun 2622 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andres Freund proposed delaying checkpointer exit after encountering an AIO-worker statistics-flush assertion; a global barrier would not cover future walsender statistics, and a separate cleanup process seemed excessive, so the initial series kept checkpointer alive after its shutdown checkpoint #1.
- Heikki Linnakangas endorsed the design and proposed descriptive PM_WAIT_* state names, simpler signal logging, and variadic btmask_add(); Bertrand Drouvot supported the approach and reviewed naming, compiler behavior, and comments #2 #3.
- Andres incorporated that feedback and discovered that using SIGTERM would conflict with system-wide shutdown signaling, so the revised series moved ordinary checkpoint requests to SetLatch(), freeing SIGINT for the shutdown checkpoint while retaining SIGUSR2 for checkpointer exit #4.
- Bertrand Drouvot and Nazir Bilal Yavuz reviewed the revised prerequisites and shutdown patch, suggesting comment, macro, and log-message improvements; Andres retained PM_WAIT_XLOG_ARCHIVAL and explained that unrelated shutdown function names should remain unchanged #7 #8 #9 #10.
- The initial landing used #4: the state wrapper and signal logging received light edits in 7148cbbdc6 and 40d4031abd, while variadic btmask_add() and state renaming landed unchanged in e84712c738 and 28e7a9968e; Andres reported that the first five patches were committed #11.
- The two-patch remainder added fatal-error handling for unexpected shutdown-checkpoint notifications, and Andres questioned placing checkpointer termination after dead-end-child cleanup because fatal paths could reach that cleanup without a live checkpointer #11.
- Bertrand agreed that signal-confirmation machinery would overcomplicate the problem, supported treating unexpected WAL shutdown as fatal, and favored terminating checkpointer before dead-end children; Andres also established that checkpointer fork-failure paths remained reachable #12 #13.
- Andres expanded the remainder into seven patches, extracting HandleFatalError(), removing duplicated child termination and repeated crash transitions, covering previously inconsistent states, and adjusting process-exit masks while moving checkpointer termination before dead-end cleanup #14.
- Bertrand reviewed every patch and questioned redundant shutdown checks, ownership of FatalError assignment, and preservation of fork-failure behavior; Andres kept FatalError assignment inside the helper and deferred a dedicated fork-failure diagnostic because it required separate message and error-code design #15 #16 #17.
- The final series added helper precondition assertions, routed late fatal errors directly to PM_WAIT_DEAD_END, cleared the completed shutdown-checkpoint flag, and polished comments; Andres also explained why disabling connection acceptance before returning to ServerLoop prevents the suspected connection window #18.
- The final latch prerequisite and termination deduplication landed unchanged from #18 as 4d271e3ec2 and d239c1a8e5, while f0b7ab7251 retained the early-return code with a small commit-message clarification.
- The helper extraction, fatal-error consolidation, and process-exit-mask adjustment also landed from #18 without code changes beyond whitespace as 8edd8c77c8, 463a2ebd9f, and f15538cd27.
- After the prerequisite commits showed no related buildfarm failures, Andres landed the shutdown reordering from #18 as 87a6690cc6, retaining its code and refining its commit explanation, then confirmed the whole series was pushed #19.
- Bertrand reported no apparent related buildfarm failures and accepted the connection-acceptance explanation; discussion continued about better diagnostics for fork failures and an immediate-restart reconnection hint #20 #21.
- At the final message, the submitted series was committed, while Bertrand's follow-up remained open: pg_ctl implements immediate restart as stop followed by start, so he outlined possible ways to communicate restart intent to postmaster without an agreed implementation #22.