model-writtenrun 7927 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Denis Patron reported that dropping large indexes left deleted segment files consuming disk space while idle connections retained open descriptors, potentially tying up hundreds of gigabytes for hours #1 #4.
- Kyotaro Horiguchi explained that descriptors would close when the next transaction processed invalidations, while Andres Freund proposed periodic invalidation processing; Thomas Munro instead proposed truncating the files, and Tom Lane favored that approach because it avoided overhead during normal processing #2 #3 #5 #6.
- Thomas posted a patch to truncate later segments on commit and the first segment during recovery, and Kyotaro suggested avoiding unlink attempts after truncation encountered ENOENT; Thomas also advocated backpatching the fix, subject to review and testing #7 #8 #10.
- Pavel Borisov supplied a small refactoring of Thomas's patch, Neil Chen tested it and examined return-value handling, and David Zhang demonstrated that the patch released space held by deleted index segments; Pavel then reported passing tests and marked the patch ready for a committer #11 #12 #13 #14 #15 #16.
- Thomas revised do_truncate() to return status and avoid redundant unlink calls after ENOENT, supplied an older-branch variant, and added a separate development-branch optimization using truncate() with a Windows fallback #17.
- The final submission's first patch landed unchanged as 9f35f94373 and was backpatched, while its second patch landed modulo whitespace as the development-branch-only optimization 57faaf376e #17 #18.
- After committing, Thomas noted that some error cases could still leave higher-numbered segments behind and suggested that the checkpointer might scan for related files before allowing the relation identifier to be recycled; that additional safeguard remained an idea #18.
- Michael Paquier questioned whether the fix warranted backpatching, Thomas defended treating the operational problem as a bug while offering to revert if consensus required it, and Michael ultimately accepted Thomas's judgment, leaving both changes landed with no revert requested #19 #20 #21.