model-writtenrun 188 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bharath Rupireddy reported that failed WAL reads leaked raw file descriptors, potentially exhausting descriptors or retaining unlinked WAL files until a server PANIC, and proposed memory-context cleanup with versions intended for supported branches #1.
- Sami Imseih tested the initial patch and found that physical walsenders also leaked a descriptor on clean streaming termination; Chao Li requested an explicit no-error callback contract and backend-only fields, later clarifying that he supported the callback approach #2 #3 #6.
- Michael Paquier argued that readers which never open files should not register cleanup, leading Bharath to move registration from allocation into the first segment-open path and retain the reader's own memory context #4 #5 #7.
- Michael then identified that generic registration could close stale descriptors when a reader used transaction-managed files; Bharath favored a shared helper explicitly called by segment-open implementations, and Michael supplied that design for all three core BasicOpenFile() users and checked the original reproducer #8 #9 #10.
- The backpatch plan was dropped because changing XLogReaderState would break ABI compatibility and older branches lacked callback unregistration; Bharath accepted a development-branch fix while leaving PostgreSQL 19 to the committer's judgment #8 #9 #16.
- Bertrand Drouvot supported the callback composition and requested checks accepting every negative descriptor sentinel plus documentation distinguishing unmanaged descriptors; Alexandre Felipe raised broader descriptor tracking, which Michael considered unnecessary for the single descriptor held by each reader #11 #12 #13 #15.
- Bharath incorporated Bertrand's feedback into the reset callback, renamed the helper and callback, refined comments, and reported running indentation checks and tests #16.
- Michael committed the final main patch as cb1eef81c9, with light comment and code-placement edits plus integration with intervening ZSTD code, and announced its application on HEAD #17; the commit declined all backpatches, including PostgreSQL 19 because its release was too close.
- After the main fix landed, Bertrand submitted the separately scoped XLogReaderFree() comparison change; Bharath questioned its practical necessity for core callbacks, and Bertrand explained that external callbacks could legitimately use other negative sentinels under the documented contract #18 #19 #20.
- Michael committed Bertrand's one-line patch unchanged as 412848dac3 and explained that he had deliberately kept it separate from the main fix; both changes were landed by the thread's final message, with no backpatch work remaining in scope #21.