Fix: disable parallel index build on QD and AO tables (#12) - #15
Merged
my-ship-it merged 1 commit intoJul 16, 2026
Merged
Conversation
…trib#12) HNSW and IVFFlat manage their own parallel builds via plan_create_index_workers(), bypassing the guard in core's index_build() (catalog/index.c) that disables parallel index builds on the dispatcher and for AO tables. On the QD, the coordinator's empty, never-analyzed copy of the table still gets a 10-page default size estimate, so parallel workers can be launched (e.g. with min_parallel_table_scan_size lowered). Those workers are forced to GP_ROLE_EXECUTE by ParallelWorkerMain() and inherit QE-only globals (ic_htab_size, numsegmentsFromQD) from the QD leader, where both are 0. The worker then crashes: - assert builds: FailedAssertion("ht->size > 0") in initConnHashTable (contrib/interconnect/udp/ic_udpifc.c) - non-assert builds: "cannot access table ... in current transaction" from the numsegments sanity check in cdbcat.c Mirror the core guard in ComputeParallelWorkers() (hnsw) and AssignTuples() (ivfflat). Parallel builds on segments are unaffected: QE backends hand valid interconnect state to their workers, and each segment still uses parallel workers after this change. Fixes cloudberry-contrib#12
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughParallel index builds for HNSW and IVFFlat now disable worker execution when running as a dispatcher or against append-optimized tables. HNSW imports Cloudberry role declarations, while IVFFlat applies equivalent eligibility checks before planning workers. ChangesParallel index-build guards
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
HNSW and IVFFlat manage their own parallel builds via plan_create_index_workers(), bypassing the guard in core's index_build() (catalog/index.c) that disables parallel index builds on the dispatcher and for AO tables.
On the QD, the coordinator's empty, never-analyzed copy of the table still gets a 10-page default size estimate, so parallel workers can be launched (e.g. with min_parallel_table_scan_size lowered). Those workers are forced to GP_ROLE_EXECUTE by ParallelWorkerMain() and inherit QE-only globals (ic_htab_size, numsegmentsFromQD) from the QD leader, where both are 0. The worker then crashes:
Mirror the core guard in ComputeParallelWorkers() (hnsw) and AssignTuples() (ivfflat). Parallel builds on segments are unaffected: QE backends hand valid interconnect state to their workers, and each segment still uses parallel workers after this change.
Fixes #12
Change logs
Contributor's checklist
Here are some reminders before you submit your pull request:
Summary by CodeRabbit