model-writtenrun 6167 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bertrand Drouvot reported that an error opening a TOAST relation caused memory accounting to subtract a change twice during logical-decoding cleanup, and proposed moving relation opening before the initial subtraction in #1.
- Amit Kapila pointed out that allocation failures and other errors could occur throughout TOAST replacement, so he proposed saving the original size and performing both accounting updates only after replacement completed; Dilip Kumar supported this broader approach in #2 and #3.
- Bertrand outlined API alternatives in #4, while Dilip suggested an API accepting old and new changes in #5; Amit explained that the old change is overwritten and recommended passing an explicit size at every existing accounting call in #6.
- Dilip questioned handling of internal tuple-CID changes in #7, but Amit explained that the existing exclusion in ReorderBufferChangeMemoryUpdate remained sufficient in #8, and Dilip agreed in #9.
- Amit and Bertrand agreed to backpatch through PostgreSQL 13 as a precaution in #11 and #12, and Bertrand supplied the redesigned master patch in #13.
- Amit approved the implementation, clarified its error-handling comment, and ran pgindent in #14; Bertrand then supplied a tested PostgreSQL 13 adaptation and confirmed that the master patch also applied to PostgreSQL 14 in #15.
- Amit committed the master revision from #14 as df3640e529, correcting only a comment typo, with backports through PostgreSQL 13; Bertrand acknowledged the commits and closed the commitfest entry in #16.
- After landing, Alvaro Herrera questioned the amount of work inside PG_CATCH in #17, and Tom Lane raised concerns about subtransaction cleanup, selective error rethrowing, and an unexercised error path in #18.
- Amit explained the required subtransaction cleanup sequence and the differing WAL sender, SQL decoding, and streaming error paths in #19, reporting debugging and test failures when cleanup was removed; the accounting fix remained committed, with no further patch or explicit resolution of the broader cleanup concerns shown.