model-writtenrun 2961 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that a timed-out REINDEX CONCURRENTLY leaves an invalid TOAST index that causes a subsequent VACUUM FULL to access invalid memory or fail an assertion, and supplied a reproducer #1.
- Tender Wang traced the failure to an invalid index remaining in pendingReindexedIndexes after its memory was reset at transaction end, and supplied a patch replacing the warning with removal from the pending list #2.
- Tender Wang then proposed guarding removal with REINDEX_REL_SUPPRESS_INDEX_USE #3; Michael Paquier confirmed that this flag identifies the affected VACUUM FULL/CLUSTER path, reproduced the issue back to PostgreSQL 12, and posted a revision retaining the warning for monitoring #4.
- Michael Paquier kept the relation-cache index list intact and removed skipped invalid TOAST indexes only from the reindex pending list; he also identified unnecessary rebuilding of invalid non-TOAST indexes as a separate concern left outside this fix #4.
- Tender Wang approved the revision #5, and Michael Paquier committed it with only comment punctuation and commit-message changes, crediting Tender as author and backpatching through PostgreSQL 12 09620ea091.
- Michael Paquier closed the thread by confirming the fix and backpatches, while leaving reliable regression coverage as future work involving injection points, isolation tests, and forced-error SQL tests #6.