Repository navigation
fix(pg_upgrade): keep the status file at running in local and CI mode - #2749
Draft
idawson-sb wants to merge 1 commit into
Draft
idawson-sb wants to merge 1 commit into
idawson-sb wants to merge 1 commit into
Conversation
initiate.sh writes "running" to /tmp/pg-upgrade-status, then deletes it before a local (IS_LOCAL_UPGRADE) or CI run. So during the run the file is absent, and check.sh and other readers see no upgrade. This is the documented way to test the upgrade scripts on a running machine. Keep the file at "running" in all modes. cleanup() already writes the final status at the end of the run, in all modes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Package version diffCompares built package versions in legacyPackages between this PR and the tip of the base branch, per system. aarch64-linux: Closure size: 372 -> 372 (2 paths added, 2 paths removed, delta +0, disk usage -32B).x86_64-linux: Closure size: 370 -> 370 (2 paths added, 2 paths removed, delta +0, disk usage -32B). |
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 kind of change does this PR introduce?
Bug fix.
What is the current behavior?
initiate.shwritesrunningto/tmp/pg-upgrade-status. In local mode (IS_LOCAL_UPGRADE=true) and CI mode (IS_CI), it then deletes the file at once and runs the upgrade in the foreground:So during a local or CI run the file is absent, and
check.shand other readers of the file see no upgrade in progress. Local mode is the documented way to test the upgrade scripts on a running machine (nix/docs/testing-pg-upgrade-scripts.md), so these test runs look different from real upgrades.What is the new behavior?
The file stays at
runningin all modes whileinitiate_upgraderuns. This is a one-line removal.Nothing else changes:
initiate.shdoes not read the file. It only writes it.cleanup()already writes the final status (completeorfailed) at the end of the run in all modes. So the file exists after a local or CI run today too.complete.shandtests/pg_upgrade/debug.shdelete the file before they runcomplete.sh, so thecomplete.sh"already started" check still passes in CI.tests/pg_upgrade/test-start-guard.shextracts onlycleanupandon_exit, so it is not affected.Additional context
The deletion came in #695 (automated pg_upgrade testing). I could not find a reader that needs the file to be absent during the run. Please tell me if I missed one.
Related: #2748 (an EXIT trap for
complete.sh, so that the file does not stay atrunningafter an unexpected exit).Not tested yet:
IS_LOCAL_UPGRADE=true), withcat /tmp/pg-upgrade-statusduring and after the run.bash -n.🤖 Generated with Claude Code