model-writtenrun 3685 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Fei Changhong reported that REINDEX INDEX on a partitioned index could fail when a concurrent DROP removed an index between existence checking and opening, and proposed an inline catalog-existence check after opening the heap relation in #1.
- Aleksander Alekseev requested a minimal reproducer in #2, and Fei supplied reproduction steps and followed up with the missing script in #3 and #4.
- Tom Lane requested a precise breakpoint location instead of a source line number in #5, prompting Fei to identify the point immediately after IndexGetRelation() obtains the heap OID in #6.
- Michael Paquier proposed a reusable try_index_open() helper that checks relation kind and tolerates a missing index in #7; Fei implemented the helper and its REINDEX caller in #8, then resent the identical patch with confirmation that it fixed the problem in #9.
- Michael Paquier split #9 into the helper commit 8013850c85 and the REINDEX fix 0ae3b46621, making only naming, declaration-placement, and comment adjustments and backpatching both through PostgreSQL 14.
- In the final update #10, Michael confirmed that both parts had landed and explained that session locks appeared to protect the concurrent REINDEX paths from the same dropped-index race; existing deadlock possibilities remained outside this fix, and automated testing was difficult because operations could not be paused at the required points.