model-writtenrun 8722 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Justin Pryzby reopened an unresolved REINDEX CONCURRENTLY problem after finding a leftover TOAST index that DROP INDEX refused to remove, linking the earlier discussion in #1.
- Michael Paquier explained that ordinary REINDEX could turn an invalid leftover TOAST index into a valid, undroppable duplicate in #2; Julien Rouhaud proposed automatic cleanup, but Michael rejected extra implicit drops and Julien agreed to skipping invalid indexes instead in #3, #4, and #5.
- Julien submitted the initial prevention patch and isolation tests in #6, then corrected an accidentally outdated attachment in #8, replacing timeout-based cancellation with pg_cancel_backend().
- Michael's review requested consistent WARNING diagnostics and protection for direct REINDEX INDEX operations in #9; while investigating, Julien found that canceled concurrent reindexing also left orphaned indexes after DROP TABLE and reported that separate bug in #10.
- Michael initially proposed new bidirectional dependency-swapping routines in #11, then replaced them with the existing dependency-update routines without intervening command-counter increments in #12, avoiding broad catalog scans and API changes.
- Michael tested injected failures across reindex phases and clarified the command-counter constraint in #13; Julien independently tested multiple failure scenarios in #14, and the patch landed unchanged as fbcf087112, announced in #15.
- The dependency fix landed without regression tests because Michael considered cancellation through application-name matching insufficiently robust and proposed isolationtester cancellation support or backend fault injection in #15.
- Julien resumed the TOAST fix in #16, removing the tests and adding direct-index checks, then narrowed the restrictions in #18 after Michael explained in #17 that rebuilding an invalid ordinary index concurrently was intentional and useful.
- Julien started a separate isolationtester series with per-step timeouts and adapted TOAST tests in #19, targeting PostgreSQL 14; Michael demonstrated premature cancellation on slow execution in #20, and Tom Lane opposed further fixed-timeout mechanisms in #22, prompting Julien to mark that approach rejected in #23.
- Tom suggested inducing an index-build error in #26, but Michael explained in #27 that such failures occur before dependency swapping and cannot exercise the leftover old-index case.
- Michael revised Julien's TOAST patch in #28, introducing get_index_isvalid(), centralizing checks in the existing reindex routines, and choosing ERROR for direct-index operations while retaining WARNING-and-skip behavior for table operations; Julien accepted the changes in #29.
- Tom proposed detecting backend wait events instead of relying on elapsed time in #34, later clarifying in #37 that this should extend isolationtester's existing blocked-session polling.
- Michael supplied a separate dependency-cleanup test with normalized TOAST names in #36, but explicitly kept it for private use because its one-second statement timeout was unsuitable for upstream tests.
- The TOAST prevention fix from #28 landed as 61d7c7bce3, with broader TOAST namespace checks and diagnostic cleanup; Michael announced the commit in #38 and left reliable isolation tests for further work.
- Julien replaced the rejected timeout design with a wait-event-triggered cancellation prototype in #39, reporting a roughly 400-millisecond test run; Michael reviewed its locking assumptions, naming, and implementation details in #40.
- Tom objected to returning a tuple from the frequently executed polling function and to coupling state detection directly to cancellation, proposing a BLOCKED IF condition with a separate cancellation step in #41; Alvaro Herrera suggested placing the condition before the SQL for readability in #42.
- Although Michael questioned the PostgreSQL 13 schedule in #43, Tom said a modest testing change could still qualify and asked to see the implementation in #44.
- The thread ended with both backend fixes committed and the testing infrastructure unresolved: Julien explored CANCEL IF BLOCKED and WAIT UNTIL BLOCKED in #45 and #47, Tom reiterated separating state detection from cancellation in #46, and his final reply questioned whether the proposed waiting behavior already existed in #48.