Repository navigation
Upgrade safety: upgrade-verify, one-step rollback, cross-version and mixed-client tests - #257
Merged
Merged
Conversation
…ion clients, upgrade-verify, one-step rollback (P-upgrade-safety) A 0.20.4 build (commit 0a9c7c5) is unpacked from git history into a temp venv; the tests skip with a reason on a shallow clone, and CI now checks out full history. Co-Authored-By: Claude <noreply@anthropic.com>
…ent steps assert no @err, teardown kills the rolled-back serve first (P-upgrade-safety) Co-Authored-By: Claude <noreply@anthropic.com>
…), scripts/upgrade-rollback.sh, doc and CHANGELOG (E-upgrade-safety) upgrade-verify asks the running serve (any version) for a checkpoint into a scratch dir and compares session ids and rows/edges per session with the saved manifest. The rollback script swaps the venv link back, restores the saved state dir with the manifest un-retired, sets the new state aside, and waits for a clean old restore. In-process CLI runs now return their typer.Exit code instead of 0. Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
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.
Why
Owner goal (0.20.5 rollout, held by Devicor): an upgrade must not lose any session or row. Clients on 0.20.4 and 0.20.5 must keep working against either serve. A health and data check must pass before the upgrade counts as done, and a failure exits non-zero. Rollback must be one step: one command that brings back the old venv and the saved sessions. Credentials (tickets) belong to Atelier and are out of scope here.
What
memnet admin upgrade-verify --before <manifest>runs in the client. It asks the serve for a checkpoint into a scratch dir, which is removed afterwards, so it also works against a 0.20.4 serve. It compares session ids and rows/relations per session. Exit 3 on any mismatch; exit 2 for no serve, a wrong token or a bad file.scripts/upgrade-rollback.shis the one-step rollback:.pre-upgradecopy, with its manifest marked not retired;serve_client.py: when the CLI runs a command in its own process, it now returns the command's real exit code instead of 0.docs/operations/safe-upgrade.md:.pre-upgrade;[Unreleased].Tests (real processes)
test_upgrade_cross_version.py::test_old_serve_upgrades_to_new_and_rolls_back: a real 0.20.4 serve (built from 0a9c7c5) with 3 live sessions → upgrade-prepare → stop → new code on the same port and state dir → session ids, rows/relations and query output matchtest_mixed_version_clients.py: old client against new serve; pooled client against old serve; pool recovery when the serve closes; new → old → newtest_upgrade_verify.py(6 tests: pass, mismatch names, rows/relations/count failures, bad file or no serve, wrong token, scratch cleanup), plus the real run in the cross-version testtest_upgrade_rollback.py(6 tests) plus the real rollback in the cross-version test, where the 0.20.4 serve comes back with every sessionLocally, on master 51c351c: these 17 pass, and ruff is clean.
LATER
helperRollsBackis pinned absent, so the model is unchanged.ConnectionErrorand does not retry. A retry could run a mutate twice.upgrade-verify. The script itself checks the restore count.scripts/has 23 ruff errors and aruff formatcrash; both were there before this PR.