Repository navigation
Conversation
Clustering by PAX columns rewrites micro-partitions and changes tuple IDs. Leaving the index entries untouched can make an indexed query miss rows that a sequential scan still finds. In the regression case, the indexed lookup for c1 = 42 returns (42,714) before CLUSTER and zero rows afterward. Rebuild the indexes after removing the old micro-partition entries so their TIDs refer to the rewritten table. Add a PAX regression case that checks the indexed result before and after CLUSTER.
The column-based CLUSTER utility hook rewrites PAX micro-partitions with only an AccessShareLock on the coordinator. A concurrent UPDATE can commit while the rewrite is in progress, after which CLUSTER fails with tuple concurrently updated. A concurrent INSERT can also complete before CLUSTER finishes. Acquire an AccessExclusiveLock before dispatching the rewrite and hold it until transaction end. Apply the same locking to database-wide CLUSTER. Add isolation coverage for concurrent UPDATE and INSERT through both paths.
reshke
marked this pull request as draft
November 24, 2026 18:49
Contributor
Author
|
second commit currently directly breaks what https://github.com/apache/cloudberry/blob/4ee39f781d25d488ff138d912763b364902189b5/contrib/pax_storage/doc/README.clustering.md describes. I will make another commit here |
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.
Clustering by PAX columns rewrites micro-partitions and changes tuple IDs. Leaving the index entries untouched can make an indexed query miss rows that a sequential scan still finds. In the regression case, the indexed lookup for c1 = 42 returns (42,714) before CLUSTER and zero rows afterward.
Rebuild the indexes after removing the old micro-partition entries so their TIDs refer to the rewritten table. Add a PAX regression case that checks the indexed result before and after CLUSTER.
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions