model-writtenrun 7657 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andrus reported frequent WAL rename permission errors on PostgreSQL 13.1 for Windows, reaching ten-second intervals under load, although users had not reported application failures #1.
- Laurenz Albe suggested antivirus interference, but disabling Windows Defender protection did not stop the errors; Michael Paquier also explained that disabling wal_recycle would not eliminate the rename-before-deletion path and that abandoned .deleted files were skipped by subsequent checkpoints #2 #3 #7 #9.
- Thomas Munro proposed identifying processes holding files open and preserving more Windows error information, while Tom Lane noted that mapping Windows errors to errno could obscure the actual failure #10 #11.
- Andrus traced affected WAL handles to PostgreSQL's background writer and idle backends; Thomas Munro explained that PostgreSQL normally permits concurrent renaming through its file-sharing flags, leaving the cause unresolved #18 #19 #21.
- Michael Paquier posted a full revert restoring the Windows rename() path and explained that the ten-second interval came from pgrename() exhausting its retry loop; he requested testing both an unpatched build and the attached fix to establish causality #24.
- Because building PostgreSQL was inconvenient for Andrus, Michael offered paired patched and unpatched binaries and checked which optional dependencies the deployment required #26 #29 #30.
- Process Monitor showed DELETE PENDING and BUFFER OVERFLOW results, prompting Tom Lane to investigate a possible win32stat.c buffer mismatch; Michael pointed out that the suspected code was absent from PostgreSQL 13, and Tom withdrew that hypothesis #32 #35 #36 #37 #38.
- Guy Burgess reported matching symptoms and agreed to test a build, while Michael identified the suspected regression as replacing a single rename with CreateHardLinkA() followed by unlink() during WAL recycling #39 #41 #42.
- Andrus reported eight error-free hours with the patched build, but confirmed that he had not tested Michael's unpatched control build #43 #44 #45.
- Andrus subsequently reported permission errors when renaming temporary statistics files, showing that the patched build had not eliminated every permission-related symptom #46.
- Michael committed the WAL recycling fix as 909b449e00, with a PostgreSQL 13 backport; the supplied record attributes the final patch to the later submission #679508 in thread #70637, retaining durable_rename_excl() and refining comments instead of applying this thread's full revert unchanged.
- At the thread's close, Andrus confirmed that WAL errors appeared resolved but statistics-file errors and stale-statistics warnings persisted; Michael explained that statistics renaming used a separate code path requiring its own investigation #47 #48.