model-writtenrun 9370 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Michael Paquier opened the investigation after two buildfarm standby shutdowns timed out, initially suspecting recent checkpoint changes #1.
- Tom Lane observed that shutdown checkpoint processing never began and suspected lost latch wakeups #2; Robert Haas supported preserving nested wakeups #3, while Andres Freund proposed changing outer loops and latch documentation to wait only when no work remained #4 #5.
- Tom's diagnostic attachment asserted that the checkpointer reset its latch only at the main-loop entry, but check-world passed without triggering it, weakening the unexpected-reset hypothesis #7.
- Historical buildfarm failures showed that the problem predated PostgreSQL 12 #8, and Tom redirected attention toward WAL receivers remaining alive and preventing the postmaster from requesting checkpointer shutdown #10.
- Thomas Munro identified ereport(FATAL) running inside the WAL receiver's signal handler as a possible source of libc deadlocks #15; after unsuccessful reproduction attempts, Tom posted a fix removing immediate interrupts and making receive waits process interrupts through the latch #18.
- Thomas reviewed the patch and its removal of obsolete ImmediateInterruptOK machinery #19, and Tom committed it with only a comment correction as a1a789eb5a, initially deferring backpatching for more testing.
- After the commit, Andres questioned whether blocking sends could delay shutdown #21; Tom explained that the small outgoing messages should not exhaust kernel buffers #22, and Andres accepted that explanation #23, leaving nonblocking sends outside this fix.
- Ashwin Agrawal supplied a Greenplum stack trace showing a signal-handler exit deadlocking in free after interrupting malloc #24; Tom requested testing of the committed fix #25 and deferred backpatching until confidence improved #27.
- In June, Alvaro Herrera reported that the relevant master buildfarm failures had disappeared while stable-branch failures continued, supporting backpatching #28; Tom limited the backports to PostgreSQL 10 and 11 because older branches had substantial conflicts and different replication code #31, with Michael agreeing #32.
- The remaining buildfarm failure concerned standby ordering rather than shutdown #28, and Michael ended the thread with a separate patch that waits for each standby to register in pg_stat_replication before starting the next #33; the shutdown fix had landed and been backported, while this test-stability patch remained proposed.