model-writtenrun 3055 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Masahiko Sawada reported that transaction cleanup could zero its memory counter before freeing remaining TOAST data, causing an assertion failure, and proposed moving the update after TOAST cleanup with a reproducing subscription test in #1.
- Amit Kapila questioned the explicit counter reset in #2 and identified the same risk in the transaction-reset path in #4; Masahiko explained the cost of per-change heap maintenance in #3 and proposed retaining batch updates while subtracting only memory actually freed in #5.
- After discussing how to measure freed memory in #6 and #7, Masahiko submitted #8, using ReorderBufferChangeSize() directly in cleanup and truncation rather than changing ReorderBufferReturnChange().
- Shlok Kyal reproduced the subtransaction rollback crash, confirmed the revised fix worked, and supplied an additional subscription test in #9; Masahiko temporarily removed tests in #10 while seeking coverage under contrib/test_decoding because the bug was not specific to logical replication.
- Amit approved the implementation with an assertion-comment correction in #11, and Masahiko incorporated that correction and adapted Shlok's reproducer into contrib/test_decoding regression tests in #12.
- Following Amit's final approval in #13, Masahiko committed dbed2e3662 from #12, changing only one term in the commit message, with a backpatch to PostgreSQL 17, and announced the push in #14.
- Nathan Bossart requested a pgindent pass after the commit in #15, and Masahiko reported pushing the formatting correction in #16, leaving the fix landed with no outstanding review request.