Feature: dispatch T_CustomScanState in CBDB parallel walkers#1855
Open
roseduan wants to merge 1 commit into
Open
Feature: dispatch T_CustomScanState in CBDB parallel walkers#1855roseduan wants to merge 1 commit into
roseduan wants to merge 1 commit into
Conversation
Three GP-side walkers used during parallel setup —
EstimateGpParallelDSMEntrySize, InitializeGpParallelWorkers,
InitializeGpParallelDSMEntry — cased on other scan/join states but
skipped T_CustomScanState. A parallel_aware CustomScan therefore
silently under-sized its DSM and failed to attach in workers, with
no diagnostic.
Add T_CustomScanState arms that dispatch to
ExecCustomScan{Estimate,InitializeDSM,InitializeWorker}, gated on
parallel_aware to match the other node types in these switches.
Also handle T_CustomScanState in planstate_walk_kids. Upstream
planstate_tree_walker walks only css->custom_ps for a
CustomScanState; the CBDB walker previously fell through to
default (lefttree/righttree), skipping custom_ps children under
stateful walkers (cdbexplain_*, getMotionState, ...). The new
case walks custom_ps first, then lefttree/righttree if set, with
an Assert that a CustomScanState never populates both — otherwise
the child would be walked twice.
my-ship-it
approved these changes
Jul 21, 2026
yjhjstz
reviewed
Jul 22, 2026
| ExecSortEstimate((SortState *) planstate, pctx); | ||
| break; | ||
| case T_CustomScanState: | ||
| if (planstate->plan->parallel_aware) |
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.
Three GP-side walkers used during parallel setup — EstimateGpParallelDSMEntrySize, InitializeGpParallelWorkers, InitializeGpParallelDSMEntry — cased on other scan/join states but skipped T_CustomScanState. A parallel_aware CustomScan therefore silently under-sized its DSM and failed to attach in workers, with no diagnostic.
Add T_CustomScanState arms that dispatch to
ExecCustomScan{Estimate,InitializeDSM,InitializeWorker}, gated on parallel_aware to match the other node types in these switches.
Also handle T_CustomScanState in planstate_walk_kids. Upstream planstate_tree_walker walks only css->custom_ps for a CustomScanState; the CBDB walker previously fell through to default (lefttree/righttree), skipping custom_ps children under stateful walkers (cdbexplain_*, getMotionState, ...). The new case walks custom_ps first, then lefttree/righttree if set, with an Assert that a CustomScanState never populates both — otherwise the child would be walked twice.
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