Fix concurrent distribution relation lock assertion#8679
Draft
ihalatci wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d2f6f2e9-3dd6-4f20-b84a-dece8bec442f
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8679 +/- ##
==========================================
- Coverage 88.73% 88.65% -0.08%
==========================================
Files 288 288
Lines 64428 64429 +1
Branches 8113 8114 +1
==========================================
- Hits 57167 57117 -50
- Misses 4917 4971 +54
+ Partials 2344 2341 -3 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EnsureColocateWithTableIsValidcalledBuildDistributionKeyFromColumnNamewithNoLockduring concurrent-distribution preflight. On cassert builds, PostgreSQL'stry_relation_openasserts that callers usingNoLockalready hold at leastAccessShareLock, but this path held no relation lock.Acquire
AccessShareLockthrough the existing distribution-key helper and release it immediately after extraction. This keeps preflight lock retention short and preserves the laterShareUpdateExclusiveLockacquisition and distribution-column revalidation.Validation
--enable-cassert: focusedcreate_distributed_table_concurrentlyregression passed.--enable-cassert: focusedcreate_distributed_table_concurrentlyregression passed.colocate_with := 'nocolo'case returns the expected distribution-column type mismatch with no assertion or signal 6.The focused runs used
check-base EXTRA_TESTS=create_distributed_table_concurrently; the target passed on both versions. The overall harness command remained nonzero because three unrelated out-of-tree fixture tests (multi_cluster_management,multi_create_table_superuser, andtablespace) failed due to the archived source layout.Fixes #8671
Related to #8665
Fixes: #8672