Updates: the scheduler walks the backlog OLDEST-first — superseded releases are attempted, refused and quarantined, and a catch-up restarts the gateway once per release #1746

Closed
opened 2026-09-22 19:02:41 +00:00 by ben · 2 comments
Owner

Seen live on Whakatōhea Demo, 2026-09-22 18:52–18:56Z, catching the demo up from cef28743 (seq 2609) to faa423f7 (seq 2648) with the window opened by hand.

What happened, in three minutes

The scheduler's active list held 28 releases. updates_scheduler.go:186 snapshots every Automatic + Queued revision and calls Rollout on each in list order — discovery order, oldest first. There is no supersession rule anywhere in internal/update: rollable accepts any active record, and dropActive only removes one that finished.

So, in order:

  1. Nine releases OLDER than the running one were attempted and refused — b8f0cb81, 7b6b9d28, 7ceb98f5, b156e420, d3dd7481, 52abf771, bf197f49, 86580736, fd4a0df2 — each landing in history as outcome: refused with a null started_at (the #1579/#1690 replay floor doing its job: high_water.testing = 2648), then quarantined on the second attempt under the ADR 0067 budget.
  2. It then applied 3396c4b6 — a full pin, staged deploy and ADR 0259 self-restart.
  3. On the next tick it applied faa423f7, the newest: a second full deploy and a second self-restart.

Two restarts where one would have done, nine meaningless refusals in the operator's update history, and 17 superseded releases still sitting on the list, which will be re-attempted and re-refused every window from now on until each is quarantined.

Why it is wrong

A patch/security release is cumulative — faa423f7 contains 3396c4b6. Applying the older one first buys nothing and costs a member-visible restart. And a release older than current can never be applied at all (the replay floor refuses it by design), so attempting it is pure churn that pollutes history and burns the ADR 0067 budget on releases nobody will ever install.

The defect grows with the gap: a community that misses a few nights (or is founded from a build behind the feed, #1690) restarts once per window per release instead of once, and can trail the feed indefinitely while the feed publishes tens of releases a day.

Wanted

  1. Roll the NEWEST rollable release, not the oldest. For the cumulative kinds, the scheduler picks the highest-sequence rollable revision and applies that one; everything it supersedes is dropped from the active list as superseded, recorded once in history as such (never as refused, and never one row per release — the operator sees "updated to X, which includes N earlier updates").
  2. Never attempt a release at or below the replay floor. Anything with sequence <= high_water[channel] (or at/behind current) is dropped as superseded at discovery, not attempted, not quarantined, not counted against the ADR 0067 budget.
  3. A feature/major release keeps its own decision (ADR 0017, ask-me-first): it is not silently swallowed by a superseding patch. If a pending feature release is older than the newest patch, the patch applies and the feature release stays pending on its own terms.
  4. The clutter already on live communities is swept: on load, active records at or below the floor are folded into one superseded history entry. The demo carries 17 + 9 of them right now.

Acceptance

  • Given a current release and N newer cumulative ones, one tick applies exactly the newest, exactly one self-restart happens, and the other N-1 leave the active list as superseded.
  • No release at or below high_water is ever attempted; none reaches quarantined by that route.
  • A pending feature release survives a patch rollout, still pending.
  • History reads as an operator would tell it: one line per thing that actually happened.
  • A drive leg proves the catch-up on a live gateway from several releases behind, asserting a single restart.

Relates to ADR 0248 (the lane), ADR 0067 (the retry budget), #1579/#1690 (the replay floor), #1650 (the window throttle), #1745 (Update now), #1562 (the update lane arc).

**Seen live on Whakatōhea Demo, 2026-09-22 18:52–18:56Z**, catching the demo up from `cef28743` (seq 2609) to `faa423f7` (seq 2648) with the window opened by hand. ## What happened, in three minutes The scheduler's active list held **28** releases. `updates_scheduler.go:186` snapshots every `Automatic` + `Queued` revision and calls `Rollout` on each **in list order — discovery order, oldest first**. There is no supersession rule anywhere in `internal/update`: `rollable` accepts any active record, and `dropActive` only removes one that finished. So, in order: 1. **Nine releases OLDER than the running one were attempted and refused** — `b8f0cb81`, `7b6b9d28`, `7ceb98f5`, `b156e420`, `d3dd7481`, `52abf771`, `bf197f49`, `86580736`, `fd4a0df2` — each landing in history as `outcome: refused` with a null `started_at` (the #1579/#1690 replay floor doing its job: `high_water.testing = 2648`), then **quarantined** on the second attempt under the ADR 0067 budget. 2. It then applied **`3396c4b6`** — a full pin, staged deploy and ADR 0259 self-restart. 3. On the next tick it applied **`faa423f7`**, the newest: a second full deploy and a second self-restart. Two restarts where one would have done, nine meaningless refusals in the operator's update history, and **17 superseded releases still sitting on the list**, which will be re-attempted and re-refused every window from now on until each is quarantined. ## Why it is wrong A `patch`/`security` release is **cumulative** — `faa423f7` contains `3396c4b6`. Applying the older one first buys nothing and costs a member-visible restart. And a release older than `current` can never be applied at all (the replay floor refuses it by design), so attempting it is pure churn that pollutes history and burns the ADR 0067 budget on releases nobody will ever install. The defect grows with the gap: a community that misses a few nights (or is founded from a build behind the feed, #1690) restarts once per window per release instead of once, and can trail the feed indefinitely while the feed publishes tens of releases a day. ## Wanted 1. **Roll the NEWEST rollable release, not the oldest.** For the cumulative kinds, the scheduler picks the highest-sequence rollable revision and applies that one; everything it supersedes is **dropped from the active list as superseded**, recorded once in history as such (never as `refused`, and never one row per release — the operator sees "updated to X, which includes N earlier updates"). 2. **Never attempt a release at or below the replay floor.** Anything with `sequence <= high_water[channel]` (or at/behind `current`) is dropped as superseded at discovery, not attempted, not quarantined, not counted against the ADR 0067 budget. 3. **A `feature`/`major` release keeps its own decision** (ADR 0017, `ask-me-first`): it is not silently swallowed by a superseding patch. If a pending feature release is older than the newest patch, the patch applies and the feature release stays pending on its own terms. 4. **The clutter already on live communities is swept**: on load, active records at or below the floor are folded into one superseded history entry. The demo carries 17 + 9 of them right now. ## Acceptance - Given a current release and N newer cumulative ones, one tick applies exactly the newest, exactly one self-restart happens, and the other N-1 leave the active list as superseded. - No release at or below `high_water` is ever attempted; none reaches `quarantined` by that route. - A pending `feature` release survives a patch rollout, still pending. - History reads as an operator would tell it: one line per thing that actually happened. - A drive leg proves the catch-up on a live gateway from several releases behind, asserting a single restart. Relates to ADR 0248 (the lane), ADR 0067 (the retry budget), #1579/#1690 (the replay floor), #1650 (the window throttle), #1745 (Update now), #1562 (the update lane arc).

swarm-claim host=matou-dev-server-01 run=30359
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=30359 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1746 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1746,
  "status": "success",
  "commits": [
    "c0ae49d47055d59961ceb89ba7c07c88c98472a1"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/updates_scheduler.go",
    "control-plane/cmd/control-plane/updates_scheduler_test.go",
    "internal/update/history.go",
    "internal/update/rollout.go",
    "internal/update/supersede.go",
    "internal/update/supersede_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/update/ -run TestSupersedeStale -count=1",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go test ./internal/update/ ./control-plane/cmd/control-plane/ -count=1",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go test ./internal/controlapi/... -count=1",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go vet ./internal/update/... ./control-plane/cmd/control-plane/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command golangci-lint run ./internal/update/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Given a current release and N newer cumulative ones, one tick applies exactly the newest, exactly one self-restart happens, and the other N-1 leave the active list as superseded": "internal/update/supersede.go SupersedeStale keeps only the highest-sequence cumulative rollable release and folds the rest; TestSupersedeStale_CatchUpAppliesNewestWithOneRestart drives fold+Rollout+Resume over the real self-swap machinery asserting rst.calls==1 and rev-103 applied; updates_scheduler_test.go TestUpdateScheduler_CatchUpRollsNewestSupersedesRest proves one tick applies only the newest and folds N-1",
    "No release at or below high_water is ever attempted; none reaches quarantined by that route": "SupersedeStale drops any cumulative rollable with sequence <= current running sequence (staleAtCurrent) and any overtaken by a strictly-newer one BEFORE the roll loop, so they are never passed to Rollout; TestSupersedeStale_SweepsReleasesAtOrBelowCurrent and the scheduler catch-up test assert State().Quarantined is empty and no folded release applies",
    "A pending feature release survives a patch rollout, still pending": "cumulativeRollable gates on Kind.Automatic() so feature/major are never folded; TestSupersedeStale_FeatureKeepsItsOwnDecision proves a queued feature and a pending feature both survive while the older patch folds and the newest patch remains rollable",
    "History reads as an operator would tell it: one line per thing that actually happened": "recordSuperseded records ONE OutcomeSuperseded HistoryEntry per fold batch (Superseded count + SupersededBy survivor), never a row per release and never `refused`; asserted by the single-entry checks in TestSupersedeStale_NewestSupersedesOlderCumulative and the scheduler catch-up test (exactly one superseded entry, count 2, no refused entries)",
    "A drive leg proves the catch-up on a live gateway from several releases behind, asserting a single restart": "Modeled at the seam over the real FleetLander/Restarter/Resume path in TestSupersedeStale_CatchUpAppliesNewestWithOneRestart (three releases behind, asserts exactly one RestartControlPlane call and the newest applied); a live rehearsal-gateway drive can ride a later fire — noted in the commit and STATUS"
  },
  "summary": "The update scheduler now folds superseded cumulative releases out of the backlog and rolls only the single newest, so a community several releases behind restarts once instead of once per release and never attempts/quarantines an overtaken or already-passed release.",
  "blockers": []
}
**close-report** for #1746 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1746, "status": "success", "commits": [ "c0ae49d47055d59961ceb89ba7c07c88c98472a1" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/updates_scheduler.go", "control-plane/cmd/control-plane/updates_scheduler_test.go", "internal/update/history.go", "internal/update/rollout.go", "internal/update/supersede.go", "internal/update/supersede_test.go" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/update/ -run TestSupersedeStale -count=1", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go test ./internal/update/ ./control-plane/cmd/control-plane/ -count=1", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go test ./internal/controlapi/... -count=1", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go vet ./internal/update/... ./control-plane/cmd/control-plane/...", "exit_code": 0 }, { "command": "nix develop .#go-ci --command golangci-lint run ./internal/update/...", "exit_code": 0 } ], "criteria": { "Given a current release and N newer cumulative ones, one tick applies exactly the newest, exactly one self-restart happens, and the other N-1 leave the active list as superseded": "internal/update/supersede.go SupersedeStale keeps only the highest-sequence cumulative rollable release and folds the rest; TestSupersedeStale_CatchUpAppliesNewestWithOneRestart drives fold+Rollout+Resume over the real self-swap machinery asserting rst.calls==1 and rev-103 applied; updates_scheduler_test.go TestUpdateScheduler_CatchUpRollsNewestSupersedesRest proves one tick applies only the newest and folds N-1", "No release at or below high_water is ever attempted; none reaches quarantined by that route": "SupersedeStale drops any cumulative rollable with sequence <= current running sequence (staleAtCurrent) and any overtaken by a strictly-newer one BEFORE the roll loop, so they are never passed to Rollout; TestSupersedeStale_SweepsReleasesAtOrBelowCurrent and the scheduler catch-up test assert State().Quarantined is empty and no folded release applies", "A pending feature release survives a patch rollout, still pending": "cumulativeRollable gates on Kind.Automatic() so feature/major are never folded; TestSupersedeStale_FeatureKeepsItsOwnDecision proves a queued feature and a pending feature both survive while the older patch folds and the newest patch remains rollable", "History reads as an operator would tell it: one line per thing that actually happened": "recordSuperseded records ONE OutcomeSuperseded HistoryEntry per fold batch (Superseded count + SupersededBy survivor), never a row per release and never `refused`; asserted by the single-entry checks in TestSupersedeStale_NewestSupersedesOlderCumulative and the scheduler catch-up test (exactly one superseded entry, count 2, no refused entries)", "A drive leg proves the catch-up on a live gateway from several releases behind, asserting a single restart": "Modeled at the seam over the real FleetLander/Restarter/Resume path in TestSupersedeStale_CatchUpAppliesNewestWithOneRestart (three releases behind, asserts exactly one RestartControlPlane call and the newest applied); a live rehearsal-gateway drive can ride a later fire — noted in the commit and STATUS" }, "summary": "The update scheduler now folds superseded cumulative releases out of the backlog and rolls only the single newest, so a community several releases behind restarts once instead of once per release and never attempts/quarantines an overtaken or already-passed release.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1746
No description provided.