model-writtenrun 9841 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Michael Paquier proposed making archive status deletion durable because a crash could leave a .ready file whose WAL segment had already disappeared, potentially blocking archiving #1.
- Andres Freund pointed out that durable deletion would not eliminate the crash window and would add cost, while Stephen Frost proposed teaching the archiver to discard orphan status files or cleaning them during recovery #2 #4 #5 #7.
- Michael initially chose recovery-time cleanup and posted a replacement that scanned archive_status for orphan .ready and .done files before syncing the data directory #8 #9.
- Nathan Bossart raised startup-delay concerns, and Kyotaro Horiguchi suggested scanning WAL files instead of status files; Michael retained status files as the archiver's work list and moved the existence check into the archiver #10 #11 #12 #13.
- Nathan found that the archiver patch needed to distinguish ENOENT from other stat() failures, retry unsuccessful removals and continue immediately after successful cleanup; Michael incorporated those changes with a separate cleanup retry counter #14 #18 #19 #21.
- Nathan built and manually tested the revised patch, then suggested clearer comments and warnings; Michael incorporated those wording changes into the final attachment #22 #23 #24.
- Kyotaro observed that a durable_unlink() fsync failure would leave subsequent retries failing because the file was already removed; Michael chose plain unlink(), reasoning that any orphan reappearing after another crash would be cleaned again, and Nathan accepted that change #25 #26 #27 #28.
- Michael committed the final attachment with the unlink() change, renamed retry identifiers and additional comments as 6d8727f95e, then reported completion in the thread's last message; the earlier durable-deletion and recovery-scan implementations were superseded #23 #29.