model-writtenrun 5560 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Kyotaro Horiguchi opened the thread with a fix for a promotion race identified by Fujii Masao: a restartpoint could recycle WAL without updating the checkpoint recorded in the control file, leaving a crash before the next checkpoint unrecoverable; his initial patch also removed checks he believed unnecessary because checkpoints could not run concurrently #1.
- Kyotaro linked an observed instance of the corruption #2, and Nathan Bossart later supported the fix while questioning unrelated variable substitutions, prompting Kyotaro to remove that cleanup and rebase the patch #3 #4.
- Nathan questioned the expanded lock scope and recovery-point reset #5, while Zhao Rui reported that Kyotaro's fix passed his reproduction case and supplied a TAP test that promoted a standby during a lengthy restartpoint and then killed a backend #6.
- Michael Paquier challenged the extra assertion and recovery-point reset and raised concerns about concurrent checkpoints on older branches #7; Nathan favored retaining the older-checkpoint guard, while Kyotaro argued that a delayed end-of-recovery checkpoint could leave recovery-point fields uncleared #10 #12.
- Michael and Tom Lane considered Zhao's test too expensive and dependent on timing for permanent inclusion, and Kyotaro agreed that a cheap, reliable test would require dedicated debugging support #8 #9 #14.
- Michael clarified that checkpoint information should retain its older-checkpoint guard while recovery-point updates should depend on archive-recovery state #15, then supplied a revised patch incorporating those decisions and Zhao's adapted test, explicitly planning to omit the expensive test and initially defer backpatching #16.
- Nathan questioned whether retaining minRecoveryPoint after promotion could break a subsequent backup restore #17, and Michael explained that backup startup forces a checkpoint and that a backup spanning standby promotion cannot finish successfully #18.
- Michael committed the production-code portion of #16 as 7863ee4def, omitting the TAP test and nesting all control-file updates beneath the older-checkpoint guard while retaining archive-recovery checks for recovery-point and shutdown-state changes #19.
- The thread ended with Michael reporting backpatches to all stable branches; a cheaper deterministic regression test remained unresolved, with support for stopping execution at selected internal points suggested as a possible solution #20.