Skip to content

Fix gpactivatestandby after clean shutdown. - #1889

Open
woblerr wants to merge 2 commits into
apache:mainfrom
woblerr:fix_gpactivatestandby
Open

woblerr wants to merge 2 commits into
apache:mainfrom
woblerr:fix_gpactivatestandby

Conversation

@woblerr

@woblerr woblerr commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #1717.

For forced activation of a stopped standby, start the postmaster directly with GpStandbyStart instead of using promote_trigger_file and gpstart. Then promote it with pg_ctl promote, wait for a successful utility CHECKPOINT, read the catalog, and restart the segments.

The existing 600-second pg_ctl promote timeout is preserved. A single monotonic deadline covers standby startup, promotion, and the utility CHECKPOINT, preventing these waits from accumulating while leaving segment restart to its existing timeout handling.

Comment thread gpMgmt/test/behave/mgmt_utils/gpactivatestandby.feature

@leborchuk leborchuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, LGTM

@woblerr
woblerr force-pushed the fix_gpactivatestandby branch from 8840626 to 03bb859 Compare August 26, 2026 08:29
A forced activation previously relied on promote_trigger_file before
starting the stopped standby, allowing startup to reach catalog access
while recovery was still completing.

Start the standby with GpStandbyStart and perform the normal pg_ctl
promotion before reading the catalog. Share one 600-second monotonic
deadline across startup, promotion, and the utility CHECKPOINT retry.
Keep activation-specific handling out of gpstart and leave its CLI
unchanged.
@tuhaihe
tuhaihe force-pushed the fix_gpactivatestandby branch from 03bb859 to 2f8b71f Compare September 28, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] gpactivatestandby -f fails with CRITICAL error even though standby is successfully promoted

3 participants