model-writtenrun 9473 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Apr - May 2019 ยท 20 entries
- Michael Paquier opened the thread with an assertion failure when reindexing an individual pg_class index, relaying an offline report from Fujii-san and observing that REINDEX TABLE worked because it manipulated the index list #1.
- Michael proposed skipping inserts into indexes being rebuilt and removing the forced-index-list machinery in #2, while also describing an initdb VACUUM FULL workaround that would not repair existing installations.
- Tom Lane reproduced the failure in a newly created database, questioned whether skipped inserts could lose index entries, and identified HOT updates as the reason the bug often remained hidden #6 #7.
- Tom established that the bug predated the initially suspected releases and found a second problem: RelationSetNewRelfilenode() changed the relcache early enough to direct updates into empty new storage #12.
- Tom and Andres Freund settled on preserving the relation's previous relcache state until the command-counter boundary and passing new storage information separately, avoiding a larger restructuring of relation creation #16 #17.
- Andres supplied the broader implementation in #21; Tom's review requested keeping the non-assert HOT fast path and moving setup outside PG_TRY, while rejecting relocation of CommandCounterIncrement() to callers #23.
- Andres split that submission into the storage/table-AM repair 5c1560606d and the reindex ordering fix, strengthened assertions, and new regression coverage 3dbb317d32, announcing the initial landing in #26.
- The new tests immediately exposed deadlocks with concurrent DDL; Tom traced one mechanism to uniqueness checks waiting for uncommitted catalog tuples, while Andres identified lock-upgrade and catalog-index locking hazards #27 #424732 #33.
- Andres posted a stronger-locking prototype in #33, but Tom judged a comprehensive concurrency repair unsuitable for the imminent releases, and the prototype did not land #34.
- After initially discussing removal of the tests, Tom reported CLOBBER_CACHE_ALWAYS failures that read empty index storage and argued for retaining the tests temporarily #41.
- The agreed temporary solution moved catalog reindex checks into a separate serial test through 809c9b48f4, following #42; subsequent buildfarm results showed that previous sessions' temporary-schema cleanup could still deadlock with it #44.
- Andres diagnosed cache reloads during CommandCounterIncrement() accessing the newly allocated index before access was suppressed, then posted a delta moving that counter increment into callers #43 #48.
- Tom rejected the command-counter approach because it changed RelationSetNewRelfilenode()'s API semantics for possible external callers, and supplied an alternative that temporarily hid the target index using RelationSetIndexList() #51 #53.
- Andres warned that hiding the index could also hide future erroneous catalog updates, then proposed avoiding the unnecessary pg_class update altogether for mapped indexes; Tom adopted that approach in a replacement patch with explicit XID assignment and invalidation #58 #60 #62.
- Andres reviewed the replacement and requested an index-kind assertion; Tom incorporated that and comment cleanup, tested the result, and committed f912d7dec2, reversing the problematic operation ordering from the first landing without reverting its other improvements #63 #64 #67.
- The successful replacement made RelationSetIndexList() unnecessary, enabling Tom's follow-up f884dca495, which includes the function removal first posted in #2 plus removal of its transaction-cleanup machinery and conversion of rd_indexvalid to bool, as anticipated in #62.
- Michael reported continuing buildfarm deadlocks after the functional repair; Tom explained that these were the known test-concurrency problem and proposed retaining the scripts for manual execution while removing them from default schedules #68 #69.
- Andres removed the scheduled test from stable branches before the minor releases but temporarily retained it in development, exploring whether waiting for other sessions could make it reliable #74.
- Tom explained that autovacuum could still race those waits and recommended postponing automatic coverage until the deadlock problems were fixed; Andres also accepted that remaining REINDEX locking work could be tested on user tables #75 #80.
- Andres ultimately removed the test from development-branch schedules in 5997a8f4d7 and announced completion in #81; Tom closed the open issue in #82, leaving the crash fixes landed, manual test scripts available, and the broader catalog-reindex deadlock problem deferred.