model-writtenrun 4513 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Nathan Bossart opened the thread with a reproduced crash hazard: interrupted WAL recycling could leave two segment names pointing to one file, so #1 replaced the hard-link operation with durable_rename().
- Robert Haas argued that the unsafe helper should be removed altogether in #2, and Nathan expanded the patch to convert every caller and delete the API in #5.
- Kyotaro Horiguchi explained why ControlFileLock serialized WAL-segment installation in #8, while discussion of rename atomicity and filesystem behavior in #16 cautioned against assuming stronger guarantees than the operating system provides.
- Nathan split caller conversion from API deletion in #18 to preserve extension compatibility on backbranches, and added Michael Paquier's requested file-existence assertions in #20.
- Michael first landed the caller conversion from #20 with explanatory comments as ccfbd9287d, followed by its unchanged helper-removal component as 2c902bbf19.
- Buildfarm failures exposed concurrent retrieval of the same timeline-history file by startup and WAL-receiver processes, and Michael announced that he had reverted the changes to restore stability in #21.
- Nathan opposed production existence checks that would introduce another race in #24, and #26 instead removed only the WAL-receiver assertion while documenting that replacing an existing history file was allowed.
- After Michael endorsed the retained checks in #27, he landed the corrected caller-conversion component unchanged as dac1ff3090 in July, with the application described in #28.
- Michael then landed the unchanged helper-removal component of #26 as eb64ceac7e, deleting durable_rename_excl(), its declaration and HAVE_WORKING_LINK after all callers had been converted.
- Robert Pang reopened the issue after observing duplicate-link corruption following OOM kills in #31, and Andres Freund reported an independent corrupted server and supported backpatching in #33.
- Michael supplied PostgreSQL 13–15 adaptations in #34; Nathan and Andres approved them in #35 and #36, and Michael confirmed application in #37.
- Noah Misch relayed Arun Thirupathi's diagnosis in #39: on PostgreSQL 13 and 14, the rename backport allowed checkpoint recycling and preallocation to overwrite archive-restored WAL during restartpoints.
- Nathan supported importing the proven newer-branch solution in #40, and Michael supplied seven components in #41, including prerequisite refactoring, removal of an obsolete HINT and a known follow-up fix.
- Michael reported that both corruption signatures disappeared with the repairs in #42, and Noah confirmed the backpatches and supplied a probabilistic regression test in #46.
- Michael and Tom Lane questioned the test's low detection rate and buildfarm cost in #47 and #48, while Noah argued in #49 and #51 that existing coverage was inadequate and the repaired code offered no suitable injection-point location.
- The first component of #41 landed unchanged as 6b168c1299 and df8ec9634c, making WAL-segment installation always acquire ControlFileLock.
- The second component of #41 landed unchanged as 8967dddf08 and 20e5ef3ca7, correcting the segment-added accounting postcondition.
- The third component of #41 landed unchanged as b494640e82 and d0b6acaf04, removing XLogFileInit()'s option to unlink a pre-existing file.
- The fourth component of #41 landed unchanged as 47d2d29827, reverting the old HINT workaround because the following fixes would eliminate the race.
- The fifth component of #41 landed unchanged as 675b771ca5 and cbed472a93, preventing preallocation from reopening a segment that archive recovery could already have removed.
- The sixth component of #41 landed unchanged as 014a508009 and a5b0c06daa, disabling WAL recycling and preallocation while archive recovery owns segment installation.
- The final component of #41, credited to Bharath Rupireddy and Kyotaro Horiguchi, landed unchanged as 3635a0a35a and 69a498eb64, resetting the installation flag after a WAL receiver exits on its own; Michael confirmed the complete series was applied in #52.
- After Noah quantified the test's runtime-versus-detection tradeoff in #53, Tom and Michael withdrew their objections in #54 and #55, and the unchanged test from #46 landed as 714bd9e3a7.
- The new test exposed extremely slow archiving under skink's Valgrind child-process instrumentation in #56; Noah proposed configuration alternatives and an inline test-harness adjustment in #57.
- Andres changed skink to disable tracing through exec in #58, and Noah confirmed that this resolved the failure in #59, leaving the repair series and test landed with no outstanding patch revision requested.