model-writtenrun 8232 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Justin Pryzby reported an ExecCreatePartitionPruneState assertion failure during concurrent partition creation in PostgreSQL 13 beta, suspecting the weaker locking used by ATTACH PARTITION #1.
- Robert Haas requested the planner and executor partition arrays, and Justin's dump revealed an additional partition alongside a zero entry in the planner's map #2 #3.
- Amit Langote reproduced the failure by pausing planning with a debugger and attaching another partition, identified the unhandled zero entries introduced by static pruning, and posted an initial fix #4.
- Tom Lane reproduced the bug but found that Amit's fix could associate a zero entry with the wrong partition; his revision explicitly skipped zero entries and guarded the array bounds #10.
- Robert Haas supported replacing the trailing assertion with a runtime check, and Tom agreed before committing the revised mapping fix with that check and readability changes as 7a980dfc6c, backpatched through PostgreSQL 12 #11 #12.
- Because ordinary isolation tests could not reliably pause between planning and execution, Tom proposed a loadable planner-hook module that waits on a configurable advisory lock while another session performs DDL #12 #14.
- Andy Fan suggested general fault-injection controls, but Tom preferred a loadable module using existing hooks to avoid production overhead and exposing testing behavior in normal builds #17 #18.
- Andy implemented the module, then incorporated Tom's requests for a disabling-by-default GUC, removal of the before-planning lock, direct advisory-lock function calls, and the delay_execution name #19 #20 #21.
- Tom moved the module into src/test/modules, corrected its lock-ID control, added explicit invalidation processing, and supplied a partition-addition isolation test that reproduced the original bug when the executor fix was reverted #22.
- Andy raised the possibility of delaying execution at other hooks, which Tom left for future expansion; Tom also noted that the new test did not distinguish Amit's initial unsafe fix from the correct implementation #23 #24 #22.
- Amit and Tom discussed possible out-of-bounds access and incorrect subplan associations in the superseded initial fix, while Justin supplied further debugger data about the original failing query #25 #26 #28 #30.
- The final message confirmed that Justin's failure involved a custom plan; at that point the executor fix had landed and the testing patch awaited its announced commit #31 #22.
- Later that day, Tom committed the final testing attachment unchanged as 6f0b632f08, completing both changes while leaving broader hook coverage and a test specifically exposing the initial fix's flaws as possible future work #22 #24.