Repository navigation
Updater: one pending update at a time, and the version route reads CloudFormation - #480
Merged
Merged
Conversation
…oudFormation
Settings, System showed an older prepared update ("v0.8.37 needs your OK")
next to a newer one, "Checking v0.8.39" for a release whose change set
was already prepared, "Preparing" for a change set that was ready, and
"Review and apply" minutes after someone executed it in the AWS console.
- Preparing an update supersedes every older prepared-but-unapplied one:
its change set is deleted while it never ran, and history keeps it as
"superseded" (who replaced it, nothing changed). A change set that is
executing or still being made is never replaced; Update says why.
- The version route reconciles before it answers: the newest open update
is the pending one (fixing pointers an older updater left), older open
ones are superseded, and native_poll runs, so preparing, waiting for the
OK, applying (also when executed in the AWS console or CLI, recorded as
applied there) and the end show at once instead of up to 5 minutes later.
- native_poll never writes over a newer state (an admin's Apply, a newer
update), never sends a just-executed change set back to waiting for an
OK while CloudFormation still says AVAILABLE, reads a console
execution's failures from when the change set was made, and checks the
stack's Version output before calling an update a success.
- The model check is pending only while the release check really runs:
a pending record whose release was verified since is checked now; one
whose build ended without reporting back, or is older than 30 minutes,
is "stalled" with its reason (it still holds the update); a failed
release check says so; Check again restarts a build that ended at once;
Update now stores the check that passed.
- The preflight reports a stalled check as a blocker with its reason.
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.
Summary
The updater could leave two prepared updates open at once. It reported the stored entry instead of what CloudFormation said. It could keep a model check "pending" forever. Now there is only ever one pending update, the version route reconciles with CloudFormation before it answers, and the model check is pending only while the release check really runs. The dashboard pin moves to the dashboard PR that renders this.
The research note (one primary status, honest progress, truth from the system doing the work, a time bound on stale states, saying what needs the admin) is in the dashboard PR.
Changes
lambda/updater/handler.py: one pending update at a timebeginrefuses to replace an update whose change set CloudFormation is still making or already running, and says why.supersede_openmarks every older prepared-but-unapplied updatesuperseded(withsuperseded_by) and deletes its change set if it never ran.lambda/updater/handler.py:reconcile, run by the version route before it answersnative_pollruns.applied_by: someone in the AWS console.native_pollVersionoutput before calling the update a success.native_statusadds who started the update, when, and who applied it.history_viewshows any row still open that isn't the pending one as superseded.model_check_viewre-runs a pending check whose release has been verified since.start_verifyrestarts a build that ended without reporting, without waiting 30 minutes.update_nowstores the check that passed.services/gateway/src/routes/setup_checks.rs: a stalled check is a warning in Setup and amodel_check_stalledblocker in the preflight.selfhost/versions.json: dashboard pin bumped withscripts/bump-dashboard.sh.Verification
python3 -m unittest discover -s lambda/tests: 330 passed.OnePendingUpdatetests cover:ModelCheckTruthtests cover:cargo fmt --check --allpasses.cargo clippy --workspace -- -D warningspasses.cargo test -p gateway setup_checks: 28 passed, including the new stalled assertions.