model-writtenrun 5321 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Noah Misch opened the thread with a demonstration-only reproducer showing archive restoration unlinking a preallocated WAL segment before the checkpointer could open it, causing a restartpoint error #1.
- Noah proposed a shared flag assigning authority to install WAL segments, disabling recycling and preallocation during archive restoration while retaining them during streaming; he described drawbacks of broader locking, copying restored files, and rename-only alternatives, and initially judged the rare failure insufficient reason for backpatching #1.
- Noah submitted five production patches that simplified XLogFileInit(), corrected segment accounting, avoided the unnecessary open during preallocation, and coordinated segment installation with archive recovery; he considered removing preallocation entirely but retained it #2.
- The three preparatory components of #2 landed unchanged on June 29, 2021: unconditional locking in c53c6b98d3, corrected use_existent reporting in 85656bc305, and removal of the existing-file deletion option in 421484f79c.
- The remaining components of #2 also landed unchanged: 2b3e4672f7 avoided the preallocation open race, and cc2c7d65fc disabled recycling and preallocation during archive restoration to eliminate spurious logging and wasted work.
- In July 2022, David Steele connected reported link failures to the existing fix and asked about backpatching; Noah preferred considering a low-risk explanatory HINT, which David supported while raising a potentially related case of unbounded WAL growth #3 #4 #5.
- Noah and David initially considered whether repeated recycling failures could explain WAL accumulation, while Don Seiler reported only one link failure during an incident in which WAL continued accumulating until storage exhaustion #6 #7 #8.
- Kyotaro Horiguchi suggested skipped checkpoints as another explanation and questioned the locking scope, then withdrew the locking concern after Noah explained that InstallXLogFileSegment() searches for an available target while holding ControlFileLock #9 #10 #11.
- Noah submitted the older-branch HINT patch and rejected the proposed recycling-failure explanation for WAL growth because LOG-level failures do not stop subsequent recycling, while the possible preallocation ERROR happens afterward #12.
- Kyotaro and David approved the HINT patch, but David kept the WAL-growth question open; Noah considered the existing fixes very unlikely to resolve that issue and requested configuration and checkpoint logs to investigate skipped restartpoints #13 #14 #15.
- After the thread's final message, the HINT patch from #12 landed unchanged for older branches as 8ad6c5dbbe, crediting both reviewers; the separate WAL-growth investigation remained unresolved in the supplied discussion #15.