model-writtenrun 8601 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that terminating CLUSTER after creating a temporary table could crash PostgreSQL, supplying a reproducer and Valgrind evidence of invalid memory access during temporary-table cleanup #1.
- Tom Lane reproduced the assertion failure and traced it to pendingReindexedIndexes surviving as a static pointer after transaction-local memory was freed; he proposed moving cleanup from PG_TRY into transaction-abort processing #2.
- Tom Lane rejected keeping the list in TopMemoryContext because stale reindex flags could still disrupt catalog access, and questioned PG_ENSURE_ERROR_CLEANUP because parallel workers would lack its cleanup callback #3.
- Tom Lane attached a patch that clears reindex state early during transaction and subtransaction abort, tracks nesting depth to preserve an outer reindex operation, and initializes that depth in parallel workers; the thread ends with his request for feedback and contains no subsequent review #3.
- Tom Lane subsequently committed #3 as d12bdba77b, with light cleanup and an explicit nesting-level argument, and backported the fix to all supported branches.