Repository navigation
Upgrade notes: migration 0011 locks component while it backfills, 0007's rename fails 2.1 instances - #910
Merged
Conversation
… fails 2.1 instances (#764) The 2.2.0 upgrade notes say what the two migrations do to the 2.1 instances still serving during a rolling restart, and what to do about it. The Upgrades section of docs/deployment.md points to such notes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012e6DJb3r3wrWZ3mXUjH79T
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.
Fixes #764
docs/deployment.md(Upgrades) promises that a release that needs something other than a rolling restart says so. Two 2.2.0 migrations reach the 2.1 instances still serving during the rollout, and the notes did not say it.What changes
docs/changes/2.2.0/764.upgrade.md(new fragment, perdocs/changes/README.md: the ref is the issue the change fixes, so the existing185.upgrade.mdand642.upgrade.mdstay as they are). It says:ACCESS EXCLUSIVElock oncomponentand backfillsunlisted_aton every unlisted version before it commits, so every query oncomponentwaits, from every instance including the 2.1 ones. Advice: upgrade in a quiet window;SELECT count(*) FROM component WHERE NOT listedcounts the rows it writes.nexus_importaway from the 2.1 instances: until the last one is replaced, its import worker logsrelation "nexus_import" does not existand its import API fails. Advice: let running imports finish or cancel them before the upgrade, and start none until every instance runs 2.2.0.docs/deployment.md, Upgrades: one bullet saying that the first new instance migrates while old instances still serve, and that the upgrade notes say when a migration makes them wait or fail.How the claims were checked
By reading the code, not by running a rolling upgrade:
migrations/0011_retention_unlisted_at.sql:ALTER TABLE component ADD COLUMNand theUPDATE … WHERE NOT listedare in one migration, without sqlx's-- no-transactionmarker, soMIGRATOR.run(crates/db/src/pool.rs) runs them in one transaction.v2.1.2ships migrations 0001–0004 only, and itscrates/db/src/import_dao.rsqueriesnexus_import/nexus_import_itemby name, for the worker (claim_nextevery 5 s, lease renewal,finish) and the admin API.failedis itself a query onnexus_import, so the row staysrunning; its lease (120 s) is no longer renewed, and 2.2'sclaim_nexttakes arunningimport whose lease expired. The note therefore says the import stops on the old instance and is continued by a 2.2.0 instance, as a resumed one is (642.upgrade.md: its scan starts again).Not done here
The issue's optional part, splitting 0011 into an add-column migration and a batched backfill so that
componentis locked only for the metadata change, is a code change and is left out of this pull request.No admin API changes, so no web UI screen.
Generated by Claude Code