Repository navigation
Conversation
* Make gpexpand's new-segment shutdown mode configurable gpexpand stops newly configured primary segments during the initialization phase. Allow callers to choose the pg_ctl shutdown mode instead of fixing it in the implementation. Add -M/--mode to the -i workflow with smart, fast, and immediate as valid values. Keep smart as the default to preserve existing behavior, and document that the option does not apply to interactive input-file generation or table redistribution. (cherry picked from commit 993e877)
leborchuk
approved these changes
Nov 2, 2026
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.
What does this PR do?
Backports #2041 to
REL_2_STABLE.Adds the
-M/--modeoption to thegpexpand -iworkflow, allowing users to select thepg_ctlshutdown mode used when stopping newly initialized primary segments.Supported values are
smart,fast, andimmediate. The default remainssmart, preserving the existing behavior. Users who need to avoid waiting for active connections can explicitly select--mode fast.The option applies only during initialization with
-i. It does not affect interactive input-file generation or table redistribution.The original change was inspired by greenplum-db/gpdb-archive@f29ceca, which unconditionally switches the shutdown mode to
fast. This implementation makes the mode configurable to preserve backward compatibility.Type of Change
Breaking Changes
None. The default shutdown mode remains
smart.Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelIncludes the unit test from #2041 verifying that the configured shutdown mode is passed to
SegmentStop.The backport contains one cherry-picked commit on top of the current
REL_2_STABLE.git diff --checkpasses.Unit tests have not been rerun on the backport branch. Command to run them:
Impact
Performance:
No change by default. When
--mode fastis selected,gpexpanddoes not wait for active connections while stopping newly initialized primary segments.User-facing changes:
The
gpexpand -iworkflow now accepts-M/--modewithsmart,fast, andimmediateas valid values. The default issmart.Dependencies:
No new dependencies.
Checklist
Additional Context
Original PR: #2041
Backported commit: 993e877
Upstream reference: greenplum-db/gpdb-archive@f29ceca