model-writtenrun 7513 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tang reported subscriber relation-reference leak warnings when replica AFTER triggers fired, and Zhijie Hou traced them to trigger lookup reopening an unregistered target relation and supplied a direct-registration fix #1 #2.
- Shi Yu supplied a separate test that exercised replica triggers and searched subscriber logs for leak warnings, but that log-scanning test was not incorporated into the eventual submissions #3.
- Masahiko Sawada proposed using ExecInitResultRelation() instead of modifying the executor list directly; Zhijie Hou then identified the additional relation reference this opened and supplied the missing cleanup #4 #5.
- Amit Langote consolidated cleanup and initialization into helper functions, incorporating Masahiko Sawada's comment correction, and Tang confirmed that the revised patch fixed the reported problem #6 #7 #8 #9.
- Michael Paquier expanded the patch to manage result relations and indexes through executor cleanup, adjust snapshot timing, and change partition-routing call sites, while reserving a more complete worker redesign for future work #12.
- Amit Kapila found a missing index-opening call and objected to unnecessary index work and broad refactoring after feature freeze, recommending a small fix based on the original registration approach #13.
- The discussion considered closing trigger-opened relations and changing ExecInitResultRelation() to accept an existing relation, then settled on the direct-registration pattern already used by TRUNCATE; concerns about list allocation were resolved because ApplyMessageContext is reset after each applied message #16 #20 #21 #24 #27.
- Amit Langote restored the smaller helper-based implementation with direct relation registration, and Michael Paquier accepted it after discussing why callers should receive an explicit ResultRelInfo rather than assume an ordering in the executor list #28 #29 #30 #31.
- Zhijie Hou requested AFTER-trigger coverage, and Michael Paquier proposed recording trigger activity on partitioned subscribers; Amit Langote added tests for ordinary and partitioned relations, then simplified their functions and ordering in response to review #33 #35 #38 #39 #40.
- Michael Paquier committed the worker.c portion of #40 as f3b141c482, changing comments and leaving the tests for separate consideration because they were not necessary to close the reported bug #41.
- Michael Paquier questioned the complexity and benefit of the ordinary-table tests, so Amit Langote dropped those additions and submitted only the renamed partition tests as the remainder #41 #42.
- Michael Paquier committed that remainder as 2ecfeda3e9, adding triggers at more partition-tree levels and adjusting object names, ordering, and formatting #43.
- By the final exchange, both the leak fix and partition AFTER-trigger coverage had landed; broader executor refactoring and a possible centralized check for relation-leak warnings remained future ideas, with no attached patch awaiting commitment #31 #43 #44.