model-writtenrun 4079 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ocean li reported that retrying logical decoding after a statement timeout could fail an assertion because InitialRunningXacts and its count remained set, then supplied reproduction instrumentation and an error-handler cleanup patch #1 #2.
- Zhijie Hou reproduced the problem on PostgreSQL 11–15 and revised the fix to use PG_FINALLY with a NULL guard, avoiding uninitialized access and double cleanup #4.
- Amit Kapila requested volatile qualification and coverage for slot advancement, while Masahiko Sawada identified slot creation as another affected path; Hou incorporated these cases into successive revisions #5 #6 #7 #8 #9.
- After ocean_li_996 raised compatibility with versions lacking PG_FINALLY, Andres Freund rejected the cleanup approach because plugin shutdown callbacks could fail during error recovery and prevent system-cache invalidation #10 #11.
- Andres proposed moving the globals into SnapBuild, but Sawada explained that SnapBuild is embedded in the serialized snapshot format; Amit proposed other reset mechanisms, and Andres instead recommended a memory-context reset callback, which Amit supported #11 #12 #13 #14 #15 #16.
- Hou replaced the cleanup patches with a callback that clears InitialRunningXacts and its count when the snapshot-builder context is reset; changing SnapBuild remained an alternative with serialization and versioning complications #17 #18.
- Amit approved the callback fix, Hou supplied branch-specific patches and reported successful regression and reproduction tests, and Amit independently verified the result #19 #20 #21.
- Amit committed the callback fix as feb4e218e5, inferred from the final branch submission #20 with code matching #17 modulo branch context, and announced completion for PostgreSQL 11–15 #22; PostgreSQL 16 and HEAD were unaffected, and the broader plugin-cleanup changes were not included.