model-writtenrun 7417 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Japin Li opened the thread with an inline RelationClose() fix for the truncate path in ReorderBufferProcessTXN(), but Amit Kapila found that WAL generation already excludes the relations needed to exercise that branch and proposed an assertion instead #1 #7 #10.
- Tom Lane questioned direct use of RelationIdGetRelation(), and Amit Kapila explained that logical decoding uses historical snapshots and must avoid relation locks that could deadlock synchronous replication #3 #4.
- Andres Freund spotted a separate pgoutput leak when tuple conversion needs no map, and Amit Kapila also called for freeing map memory on cache invalidation #5 #6.
- Amit Langote supplied a memory fix that moved map creation into get_rel_sync_entry() and freed unused TupleDesc copies; Takamichi Osumi tested it and investigated how to demonstrate the leak #12 #16.
- Takamichi Osumi separately submitted the truncate assertion patch, which Japin Li tested successfully, but Amit Kapila said its disposition depended on the unresolved treatment of user catalog tables #13 #14 #15.
- Amit Kapila and Takamichi Osumi identified that moving map creation changed its invalidation trigger, so Amit Langote restored creation in maybe_send_schema(), added invalidation cleanup and a DDL regression test, then corrected the remaining TupleDesc leak and supplied a PostgreSQL 13 version #22 #23 #24 #27 #29.
- Takamichi Osumi verified the revised tests and suggested clearer comments; Amit Langote incorporated that feedback and additionally proposed suppressing redundant leaf-partition schema messages when publishing through an ancestor #30 #31.
- The user-catalog discussion established that merely skipping truncate decoding would not prevent plugins from acquiring conflicting locks elsewhere, leading Takamichi Osumi to pursue restrictions on TRUNCATE in a separate thread at Amit Kapila's request #32 #34 #36 #37 #38.
- Takamichi Osumi analyzed the schema-message optimization and found it valid but outside the memory fix's purpose, so Amit Langote separated it into a second patch #39 #41.
- Repeated testing exposed crashes when invalidation attempted to free an uninitialized map pointer; Amit Langote initialized the pointer to NULL, and Takamichi Osumi confirmed both the garbage-pointer diagnosis and successful repeated tests on the corrected patches #42 #44 #45 #46.
- Further testing found an intermittent DETACH PARTITION CONCURRENTLY isolation-test failure, which was determined to be unrelated and reported separately #48 #49 #51.
- Amit Kapila requested preserving the original schema-send ordering and deferring the nonessential schema-message optimization to PostgreSQL 15; Amit Langote submitted the memory fix alone with that ordering restored #52 #53.
- Amit Kapila committed the final memory fix from #53 as eb89cb43a0, with a PostgreSQL 13 backport, and announced the push in #54; the thread ended with Amit Langote's thanks, while the schema-message optimization was deferred and no landing of the separate truncate assertion was recorded here #55.