model-writtenrun 6187 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Aug - Sep 2021 · 18 entries
- The thread began with Andres Freund's announcement that pgstat initialization had moved into BaseInit(), with assertions checking its lifetime; Tom Lane promptly reported and reproduced an assertion failure during base-backup shutdown #1 #2 #6.
- Andres traced the failure to a backup-manifest temporary file surviving a FATAL error because resource-owner cleanup was bypassed, leaving its statistics report until after pgstat shutdown #7.
- Tom questioned making low-level file cleanup depend on shared-memory availability and suggested tolerating late statistics reports, while Andres favored separating ordinary file access from temporary-file management to retain useful statistics and expose ordering bugs #9 #11 #12.
- Andres posted the initialization split and earlier cleanup in #15, then committed 675c945394 after removing the fallback process-exit hook and retaining assertions instead of runtime errors, as explained in #18.
- Robert Haas subsequently raised concerns about circular shutdown dependencies, and Andres pointed to the split between ordinary and temporary file access as the practical response while leaving broader subsystem redesign open #19 #20.
- Masahiko Sawada then found the same pgstat lifetime assertion when a logical-replication apply worker failed while replaying streamed changes; following Amit Kapila's suggestion, he posted a separate patch moving shared-fileset cleanup to before_shmem_exit #21 #22 #23.
- Dilip Kumar and Amit confirmed the small fix, but Andres questioned its process-lifetime tracking, identified unsafe coexistence of DSM and non-DSM filesets, and argued that their cleanup semantics did not belong in one interface #24 #25 #31 #32 #35.
- Following an off-list suggestion from Thomas Munro, Dilip replaced per-transaction filesets with one fileset for the apply worker's lifetime, eliminating filesetlist tracking; Amit's review corrected the cleanup hook and duplicate filename construction #36 #37 #40.
- The design retained lazy creation of subtransaction files because creating them earlier could generate unnecessary files when all subtransactions aborted within a stream #38 #39.
- Andres proposed extracting an unshared FileSet abstraction instead of adding a nonshared mode to SharedFileSet, while Hou Zhijie and Amit found a memory leak and an incorrect deletion API in the worker optimization #42 #44 #45.
- Dilip implemented the abstraction as a two-patch series: fileset.c and fileset.h supplied common named-file operations, SharedFileSet retained shared ownership, and the worker optimization was adapted to the new BufFile APIs #48 #50.
- Review by Hou, Amit, and Masahiko made the refactor independently correct on worker exit, clarified ownership documentation, and retained removal of obsolete public APIs; further revision reused the existing worker exit hook and adopted the .fileset directory suffix #51 #53 #55 #57 #58 #59.
- Hou reported successful parallel hash-join and B-tree testing, Amit polished the refactor and fixed compilation warnings, Masahiko approved it, and Dilip rebased the optimization onto that reviewed foundation #60 #61 #62 #63.
- Amit proposed targeting PostgreSQL 15 because the changes were refactoring and improvements rather than a PostgreSQL 14 bug fix, and participants supported that scope #64 #65 #67 #69.
- Hou questioned unconditional subtransaction-state cleanup and removal of hash-based sanity checks; Dilip explained why these were appropriate without the hash table and posted wording fixes while retaining the implementation #66 #68.
- Amit committed the refactor component of #68 unchanged as dcac5e7ac1, announcing that the first patch had landed while the optimization remained under review #71.
- Masahiko and Hou approved the remaining optimization, but Amit subsequently found that its missing_ok handling could suppress real deletion failures and requested storing the fileset in LogicalRepWorker; Dilip incorporated those changes in the standalone remainder #70 #72 #74 #75.
- Amit supplied final comment edits in #76, Dilip accepted them, and the patch landed unchanged as 31c389d8de, completing both parts of the fileset series #77 #78.
Nov 2021 · 1 entry
- The last message contains Andres's thanks after returning to the thread; no patch remained pending, and the earlier narrow shared-fileset callback proposal had been superseded by the refactor and worker-lifetime fileset design #79.