model-writtenrun 6213 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Robert Haas reported that replaying CREATE TABLESPACE after a crash could erase committed data at wal_level=minimal because recovery deleted files whose contents were absent from WAL, and supplied a reproducer in #1.
- Noah Misch proposed preserving existing tablespace directories during recovery in #2; Robert endorsed the approach in #3, explaining that file redo already handles existing files and separate code recreates the tablespace symlink.
- Noah deferred committing until he had a regression test and decided against adding special handling for hypothetical crash-induced directory-permission problems because existing code did not address those elsewhere #5.
- Noah added crash-recovery tests for moved tables and newly created indexes, and preserved errors for existing non-directory objects by following TablespaceCreateDbspace() in #6; Prabhat Sahu confirmed testing both versions and endorsed the tests in #7.
- Robert approved the revised patch while requesting reporter credit and a clearer explanation of why directory deletion loses data #8; Noah supplied the expanded commit message in #9, which Robert approved in #10.
- Noah committed #6 with unchanged code and tests and the revised commit message as 97ddda8a82, with backports through PostgreSQL 9.6.
- After Robert asked whether anything still blocked committing in #11, Noah confirmed the fix had already landed in #12, and Robert acknowledged overlooking it in #13, leaving no outstanding work identified in the thread.