model-writtenrun 7438 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reported that subscription tests under CLOBBER_CACHE_ALWAYS exposed a closed partition relcache entry during AFTER triggers, an unexpectedly exiting postmaster, and TAP cleanup that could hang after failing to stop a node #1.
- Michael Paquier supplied a fix that fired triggers before tuple-routing cleanup and reproduced the bug on PostgreSQL 13 #2; Amit Langote confirmed that the patch worked under CLOBBER_CACHE_ALWAYS #3.
- Amit Kapila proposed firing triggers inside the internal apply functions #6, but Michael Paquier and Amit Langote explained that partition-moving updates perform DELETE followed by INSERT, so ending the trigger query during DELETE would break INSERT processing #7 #9.
- Andrew Dunstan identified early abortion of TAP cleanup as a separate robustness problem #11, and Michael Paquier suggested continuing shutdown attempts with a possible forced-kill fallback #14.
- Tom Lane replaced the initial fix with ApplyExecutionData and centralized tuple-routing cleanup after trigger execution #12; Michael Paquier reviewed the state representation #13, while Amit Langote warned against mutable relation state and favored explicit relation arguments #15.
- Tom Lane tried separate original and active relation fields #17, then revised the design after review to pass the actual relation explicitly and keep the replication target in stable shared state #19 #20.
- Snapshot-lifetime changes were deliberately handled separately, while Tom Lane agreed that the trigger tests should be backported to expose the older bug #16.
- Tom Lane determined that the postmaster exit was expected because TAP tests disable restart_after_crash #21, then posted a separate patch adding shutdown explanations and removing an unreachable child-process exit call #22.
- Backpatch investigation confirmed that PostgreSQL 13 still crashed under CLOBBER_CACHE_ALWAYS #25; Tom Lane traced the issue to partitioned replication targets and retained the older internal function APIs in the backpatch #26.
- The logical-replication fix landed as b39630fd41 from #20, with comment improvements, declaration relocation, and an additional trigger-side assertion checking relation reference counts.
- Amit Langote confirmed the partition-target origin of the bug #27, and Michael Paquier acknowledged the partition-test backport in the final message #28; the proposed TAP cleanup improvements remained unresolved in this thread.
- After the final thread message, the postmaster logging patch from #22 landed unchanged as bc2a389efb.