model-writtenrun 5600 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Michael Paquier opened the thread with an announcement of TAP coverage for archive_cleanup_command and recovery_end_command, using generated files to check success and log messages to check failure in #1.
- Months later, Tom Lane reported an intermittent archive_cleanup_command failure in #2; Andres Freund suggested recovery-prefetch timing as a trigger and explained that a standby restartpoint requires a checkpoint from the primary in #3 and #5.
- After reproducing the failure under Valgrind, Tom Lane supplied #7, moving the WAL position sampled by the test after the primary checkpoint; this passed the cleanup-command check but exposed a subsequent standby promotion timeout.
- Andres Freund confirmed the prefetching change triggered the failure in #8, then reported in #9 that an extra WAL switch made the test pass, identified an inaccurate description of the second standby, and traced repeated restore_command calls between replayed records.
- Thomas Munro separated the pre-existing test races from the prefetch performance bug and submitted #10, suppressing further read-ahead attempts until already-decoded records had been replayed; he reported that this alone made the test pass under Valgrind.
- Michael Paquier combined Tom's checkpoint fix with a history-file race fix in #12, retaining the second standby's original-primary backup but explicitly waiting for the first standby's history file to be archived and checking that it was restored; he rejected the extra WAL switch as an insufficient ordering guarantee.
- Thomas Munro found the missing usleep import while testing #12 and still observed a promotion timeout in #13; his separate prefetch fix landed as acf1dd4234 with the implementation from #10.
- Michael Paquier proposed replacing the explicit sleep loop with poll_query_until() and pg_stat_file(), and splitting the two test repairs because they affected different branches, in #14.
- The history-file portion of #12 landed with the revised polling implementation as e61efafcb8, and Tom Lane's checkpoint-ordering portion landed separately with a revised comment as 1a8b110539; Michael confirmed both in #17 and explained that the history fix was backpatched through PostgreSQL 11 but omitted PostgreSQL 10 because its absolute-path pg_stat_file() support was insufficient.
- The remaining discussion concerned easier Valgrind test execution: Andrew Dunstan warned that colocated executables could bypass PATH wrappers in #18, Thomas Munro shared his backend-wrapper approach in #19, and Michael Paquier closed with confirmation that skink remained quiet after all three fixes in #20.