model-writtenrun 2342 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Sergey Belyashov reported repeated logical replication worker crashes after upgrading to PostgreSQL 17 in #1, then supplied a backtrace and partitioned-table details identifying BRIN cleanup as the crash site in #3.
- Tom Lane proposed clearing the cached BRIN insertion state in #4, then recognized that the underlying problem could be repeated ExecCloseIndices calls on the same working data in #6.
- Tom's independent assertion patch in #7 reproduced duplicate closes in three subscription tests, and his investigation in #8 showed that duplicate opens accidentally balanced locks and reference counts while discarding index information.
- Tom assembled the complete repair in #12: a BRIN regression test, defensive cleanup, assertions against repeated index opens and closes, and a worker.c change that leaves partition index ownership with tuple routing.
- Tom reserved the new executor assertions for the development branch in #12 and limited the crash repair to PostgreSQL 17 and newer in #13, because older versions lacked the cleanup callback that exposed the bug.
- After Sergey reported that the worker.c patch did not apply to the stable branch in #14, Tom adapted the repair and committed the test, BRIN cleanup, and worker changes as 788baa9a25, with added caller assertions and test clarification.
- The executor assertion component of #12 landed separately with unchanged code as e596e077bb, completing the original series.
- Tom announced the available stable-branch fix in #16, and Sergey confirmed that replication worked after applying it in #17; this confirmation came after the commits.
- Zhijie Hou reopened the investigation in #18 after colleague Nisha reported a unique-constraint crash on leaf partitions: removing redundant index opens had also removed initialization needed by conflict reporting, so Hou proposed a detect_conflict flag and a regression test.
- Amit Kapila questioned branch scope and exclusion-constraint handling in #19; Hou explained in #20 that the repair was development-branch-only and exclusion metadata was already initialized, after which Amit favored deferred initialization in #21.
- Hou replaced the flag-based approach with initialization inside FindConflictTuple in #22, retaining the test and reporting passing checks plus about an 11 percent improvement in the measured bulk-insert workload.
- Amit committed the revised repair with only a comment edit as 12eece5fd5 and confirmed the push in #23, leaving both repair rounds landed and no outstanding patch in the thread.