model-writtenrun 5677 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jimmy Yih and Gaurab Dey reported that dropping a partitioned index could deadlock with ANALYZE because child indexes were locked before their tables, and proposed locking descendant tables in the relation-lookup callback with an isolation test #1.
- Tom Lane identified missing lock cleanup on callback retries, unsafe inheritance traversal, invalid-OID handling, and access to released catalog data; he also suggested moving the locking into RemoveRelations to avoid callback complexity #2.
- Jimmy Yih retained the callback approach while addressing those correctness issues, then incorporated Zhihong Yu's suggestion to consolidate a duplicated lock call #3 #4 #5.
- Tom Lane supplied a replacement series that clarified actual versus expected relation kinds and moved descendant-table locking into RemoveRelations; he also replaced the original test, which did not demonstrate a deadlock, with one that did #6.
- Tom Lane squashed that series into 7b6ec86532, adjusting the child-table lock mode to use shared callback state and adding explanatory comments, with backpatches through PostgreSQL 11.
- Jimmy Yih endorsed Tom Lane's approach after the commit and acknowledged that both patches had landed together, leaving no outstanding work stated in the thread #7.