model-writtenrun 3735 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that repeated temporary-table extensions after disk exhaustion could corrupt local-buffer state and trigger an assertion, providing a reproducer in #1; Tender Wang reproduced it and found another assertion failure in #2.
- Tender Wang initially proposed removing existing-buffer state updates and explicitly clearing victim-buffer flags in #3, but Alexander Lakhin identified a missing complement operator in #4, redirecting the fix toward clearing BM_VALID while preserving other state bits.
- Tender Wang replaced the initial approach with the one-line bitmask correction in #5, then removed a redundant existing_hdr initialization in #6; Richard Guo endorsed the correction and suggested bit-operation macros in #8, which Michael Paquier opposed because they added indirection and backpatch conflicts in #9.
- Tender Wang’s investigations in #7 and #10 explained how failed extension leaves entries in LocalBufHash and how truncation clears them; Michael Paquier saw no immediate need for additional comments but invited concrete suggestions in #11.
- Andres Freund described the difficulty of testing storage failures and proposed failure injection in #12; Michael Paquier agreed that this case could use a simple ERROR callback in #13, and Tender Wang supported that direction in #14.
- Michael Paquier committed #6 unchanged as 9cd0d77dfc and announced the backpatch through PostgreSQL 16 in #15; the commit explanation covered extension errors beyond disk exhaustion.
- The thread ended with acknowledgments from Tender Wang in #16 and Andres Freund in #17; the fix was fully landed, while additional documentation remained optional and failure-injection testing awaited infrastructure still under discussion in #15.