Skip to content

Fix gpactivatestandby after clean shutdown. - #1889

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

Fix gpactivatestandby after clean shutdown.#1889
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.

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.
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

1 participant