Uh oh!
There was an error while loading. Please reload this page.
Fix full merge join gang size crash in ORCA - #1896
Open
roseduan wants to merge 3 commits into
Open
Conversation
CPhysicalFullMergeJoin::PdsDerive unconditionally returned the outer child's distribution spec whenever it was Universal, ignoring the inner child's real distribution. When the inner child was actually Singleton (gathered to combine with a Universal/empty outer side), the join's output was mislabeled Universal. Universal trivially satisfies a Replicated requirement, so an enclosing per-segment join (e.g. a comma-join with a third relation) skipped the corrective motion this Singleton child needed, nesting a real cross-segment Gather Motion inside a per-segment execution context. The executor's sanity check in ExecInitMotion (nodeMotion.c) caught the inconsistent slice and raised "unexpected gang size: N". Fix by mirroring the already-correct sibling implementations (CPhysicalFullHashJoin::PdsDerive, CPhysicalHashJoin:: PdsDeriveForOuterJoin): propagate the inner child's real distribution instead of blindly returning the outer's.
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 freeto 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.
CPhysicalFullMergeJoin::PdsDerive unconditionally returned the outer child's distribution spec whenever it was Universal, ignoring the inner child's real distribution. When the inner child was actually Singleton (gathered to combine with a Universal/empty outer side), the join's output was mislabeled Universal.
Universal trivially satisfies a Replicated requirement, so an enclosing per-segment join (e.g. a comma-join with a third relation) skipped the corrective motion this Singleton child needed, nesting a real cross-segment Gather Motion inside a per-segment execution context. The executor's sanity check in ExecInitMotion (nodeMotion.c) caught the inconsistent slice and raised "unexpected gang size: N".
Fix by mirroring the already-correct sibling implementations (CPhysicalFullHashJoin::PdsDerive, CPhysicalHashJoin:: PdsDeriveForOuterJoin): propagate the inner child's real distribution instead of blindly returning the outer's.
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