model-writtenrun 9655 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Aug 2018 · 4 entries
- David Rowley opened the thread with a four-patch prototype that moved partition metadata into pg_partition and implemented explicit ATTACH PARTITION CONCURRENTLY through validity flags and multiple transactions; concurrent DETACH was still unimplemented, and default partitions were excluded #1.
- David then identified a repeatable-read flaw in the original waiting protocol and proposed snapshot-dependent partition visibility, while Andres Freund identified the separate danger of relcache invalidation freeing descriptors still used by running queries #2 #6.
- David supplied a supplementary descriptor-lifetime patch, but recognized that preserving memory alone did not keep runtime-pruning indexes consistent between planning and execution #7 #12.
- Robert Haas argued that ordinary DDL does not follow transaction-snapshot visibility and proposed reducing the existing commands' lock levels without a new CONCURRENTLY keyword; David and Alvaro Herrera continued examining snapshot-based alternatives and the hazards of detached or altered tables #11 #13 #14 #15.
Oct 2018 - Mar 2019 · 17 entries
- After a two-month gap, Alvaro posted a substantially different implementation with a separate descriptor cache, snapshot-owned mappings, parallel-worker reconstruction, and ATTACH/DETACH isolation tests, while acknowledging memory leaks and possible parallel-query errors #16.
- Robert proposed tackling ATTACH first because DETACH could invalidate constraints and tuple-routing assumptions, and Alvaro handed over active development; subsequent discussion exposed both detach-and-reattach correctness problems and inconsistent catalog reads during descriptor construction #17 #18 #24 #27 #36.
- Robert introduced independent list-construction cleanup and an invalidation-counter retry mechanism, while outlining a PartitionDirectory attached to planner and executor state instead of snapshots #39.
- Amit Langote rebased those prerequisites and fixed an uninitialized OID pointer; review by Michael Paquier and Robert separated memory-context redesign from the cleanup, and Robert simplified the patch before announcing completion of that preparatory work #41 #42 #43 #51 #53 #54.
- Robert resumed the feature in December with PartitionDirectory mappings, retained descriptor memory, partition-driven optimizer locking, and lower ATTACH/DETACH locks, explicitly rejecting tests that required partition membership to follow an old query snapshot #63.
- Alvaro identified that partitions inserted between planning and execution could shift pruning-array indexes, and Robert demonstrated a separate prepared-plan failure that could expose rows outside any valid partition bounds after concurrent DETACH #64 #68.
- David reviewed the new locking order and argued against adding an OID sort; Robert accepted that sorting would not restore a universal locking order once other code already acquired locks differently #69 #71.
- In January, Robert instrumented pruning plans with partition OIDs and reproduced a descriptor mismatch, posting an eight-patch series that also separated descriptor management into its own source file #74 #79.
- Robert then replaced the assertions with OID-based pruning-map reconstruction and consolidated the series into five patches, limiting the lock reduction to ATTACH because safe concurrent DETACH still required decisions about errors, changed bounds, and constraint enforcement #80.
- Following Alvaro's concern about parallel-worker consistency, Robert posted supplemental descriptor and bound serialization routines, but left their integration into shared directories unresolved #81 #83.
- David questioned parallel pruning with differing descriptors, and Robert explained that each backend independently remaps partition OIDs to the same planned subplans, making cross-backend descriptor identity unnecessary for the supported read-only parallel queries #86 #87 #88.
- Robert first landed the descriptor-file extraction from #80 as 1bb5e78218, with only minor include and rebase adjustments, leaving the functional changes pending #88.
- Robert next extracted the partition-expansion locking changes from #80 into f4b6341d5f, retaining the old locking behavior for ordinary inheritance #90.
- The remaining series moved directory ownership from PlannerInfo to PlannerGlobal and added relcache reference counting after CLOBBER_CACHE_ALWAYS testing exposed descriptor-lifetime problems #91.
- Robert then found that invalidation retries could miss the interval between transaction visibility and invalidation-message delivery, replacing that mechanism with direct pg_class lookup when cached partition bounds were missing; this solution deliberately covered ATTACH only #92.
- After performance tests showed small differences that Robert considered within measurement noise, 898e5e3290 combined all four patches from #92, adding documentation of the weaker parent lock while retaining exclusive locking on the attached partition #93.
- The thread ended with David confirming that the work had landed and Robert closing the commitfest entry; the delivered feature was concurrent ATTACH through reduced ordinary-command locking, while concurrent DETACH and shared parallel-worker descriptor serialization remained outside the implementation #94 #95 #80 #92 898e5e3290.