update lane: landing a release never advances the doorway's agent-cache RELEASE marker — /get keeps stating the founding release after the agent binary has moved on #1849

Closed
opened 2026-09-24 19:28:12 +00:00 by ben · 2 comments
Owner

Symptom

After a signed release lands through the update lane, the gateway's /get doorway keeps stating the FOUNDING release. Seen on whakatohea-demo 2026-09-24 19:22Z after the lane applied c85d2bb3 (seq 2849): /var/lib/idss/agent-cache/x86_64/idss-agent is the new agent (sha d37b291d…, matches the manifest), but /var/lib/idss/agent-cache/RELEASE still reads the previous revision — so X-IDSS-Release on GET /get?arch=x86_64 names a release whose agent is no longer what is served.

Cause

internal/fleetwire/supply.go writes the marker LAST at founding/re-supply ("RELEASE is written last, so a crash mid-fetch never leaves a release pointing at a half-landed agent"). The release lander (internal/update/land.go, fleetland) lands the agent artifact into the cache but never advances the marker — grep RELEASE internal/update/land.go is empty. The standing re-supply (oc_standing_resupply) does write it.

Why it matters

  • The doorway's release header is the staleness probe drives and the bootstrap gate read (oc_bootstrap_staleness, served-bits-vs-main): a stale marker makes a fresh agent look old.
  • A joining device's idss-agent self-identifies by the release it was fetched from; a wrong marker mis-attributes every enrolment after an update.

Fix (two-way door)

After the agent artifact is verified and renamed into place, write <AgentCacheDir>/RELEASE = the release's revision (temp + rename, same last-write ordering as supply.go). Seam test: land a release with an agent artifact → marker equals the release revision; a land that fails before the agent rename leaves the marker untouched.

Related: #1562, #1689, ADR 0051, internal/fleetwire/supply.go, internal/update/land.go.

## Symptom After a signed release lands through the update lane, the gateway's `/get` doorway keeps stating the FOUNDING release. Seen on whakatohea-demo 2026-09-24 19:22Z after the lane applied `c85d2bb3` (seq 2849): `/var/lib/idss/agent-cache/x86_64/idss-agent` is the new agent (sha `d37b291d…`, matches the manifest), but `/var/lib/idss/agent-cache/RELEASE` still reads the previous revision — so `X-IDSS-Release` on `GET /get?arch=x86_64` names a release whose agent is no longer what is served. ## Cause `internal/fleetwire/supply.go` writes the marker LAST at founding/re-supply ("RELEASE is written last, so a crash mid-fetch never leaves a release pointing at a half-landed agent"). The release lander (`internal/update/land.go`, `fleetland`) lands the agent artifact into the cache but never advances the marker — `grep RELEASE internal/update/land.go` is empty. The standing re-supply (`oc_standing_resupply`) does write it. ## Why it matters - The doorway's release header is the staleness probe drives and the bootstrap gate read (`oc_bootstrap_staleness`, `served-bits-vs-main`): a stale marker makes a fresh agent look old. - A joining device's `idss-agent` self-identifies by the release it was fetched from; a wrong marker mis-attributes every enrolment after an update. ## Fix (two-way door) After the agent artifact is verified and renamed into place, write `<AgentCacheDir>/RELEASE` = the release's revision (temp + rename, same last-write ordering as supply.go). Seam test: land a release with an agent artifact → marker equals the release revision; a land that fails before the agent rename leaves the marker untouched. Related: #1562, #1689, ADR 0051, `internal/fleetwire/supply.go`, `internal/update/land.go`.

swarm-claim host=elitebook-distributed-server-03 run=32059
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=32059 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1849 — status success

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

envelope
{
  "issue": 1849,
  "status": "success",
  "commits": [
    "55909b7a0a83c2bbce0ba4f97f9c16b51fe4a70a"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/updates_scheduler_refusal_test.go",
    "internal/fleetland/fleetland.go",
    "internal/fleetland/fleetland_test.go",
    "internal/update/land.go",
    "internal/update/land_test.go",
    "internal/update/rollout.go",
    "internal/update/rollout_land_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/fleetland/... ./internal/update/...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/fleetland/... ./internal/update/... ./control-plane/cmd/...",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci (pre-push gate: gofmt/vet/golangci-lint/build/test) — 0 issues",
      "exit_code": 0
    }
  ],
  "criteria": {
    "After the agent artifact is verified and renamed into place, write <AgentCacheDir>/RELEASE = the release's revision (temp + rename, same last-write ordering as supply.go)": "internal/fleetland/fleetland.go: the ArtifactAgent block now calls landFile(l.releaseMarkerPath(), []byte(revision), 0o644) immediately after the agent landFile succeeds; releaseMarkerPath() derives <AgentCacheDir>/RELEASE from agentPath's grandparent; the release revision is threaded via update.Lander.Land/NodeLander (internal/update/land.go) from rollout.go's rec.Release.Revision",
    "Seam test: land a release with an agent artifact → marker equals the release revision": "internal/fleetland/fleetland_test.go TestLand_AgentArtifactAdvancesReleaseMarker — lands revision \"2849\" with an agent artifact, asserts marker == \"2849\" over a stale founding-rev marker",
    "Seam test: a land that fails before the agent rename leaves the marker untouched": "internal/fleetland/fleetland_test.go TestLand_FailedAgentRenameLeavesMarkerUntouched — the per-arch agent dir is a file so landFile's MkdirAll fails before any rename; Land returns an error and the marker still reads founding-rev. Plus TestLand_NoAgentArtifactLeavesMarkerUntouched (no agent artifact → marker untouched) and TestRestore_PutsPreviousBinaryAndPanelBack asserts the marker rolls rev-B→rev-A on rollback"
  },
  "summary": "The update-lane node lander now advances (and rolls back) the agent-cache RELEASE marker beside the landed agent, so /get's X-IDSS-Release names the release whose agent it actually serves.",
  "blockers": []
}
**close-report** for #1849 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1849, "status": "success", "commits": [ "55909b7a0a83c2bbce0ba4f97f9c16b51fe4a70a" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/updates_scheduler_refusal_test.go", "internal/fleetland/fleetland.go", "internal/fleetland/fleetland_test.go", "internal/update/land.go", "internal/update/land_test.go", "internal/update/rollout.go", "internal/update/rollout_land_test.go" ], "tests": [ { "command": "go test ./internal/fleetland/... ./internal/update/...", "exit_code": 0 }, { "command": "go vet ./internal/fleetland/... ./internal/update/... ./control-plane/cmd/...", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci (pre-push gate: gofmt/vet/golangci-lint/build/test) — 0 issues", "exit_code": 0 } ], "criteria": { "After the agent artifact is verified and renamed into place, write <AgentCacheDir>/RELEASE = the release's revision (temp + rename, same last-write ordering as supply.go)": "internal/fleetland/fleetland.go: the ArtifactAgent block now calls landFile(l.releaseMarkerPath(), []byte(revision), 0o644) immediately after the agent landFile succeeds; releaseMarkerPath() derives <AgentCacheDir>/RELEASE from agentPath's grandparent; the release revision is threaded via update.Lander.Land/NodeLander (internal/update/land.go) from rollout.go's rec.Release.Revision", "Seam test: land a release with an agent artifact → marker equals the release revision": "internal/fleetland/fleetland_test.go TestLand_AgentArtifactAdvancesReleaseMarker — lands revision \"2849\" with an agent artifact, asserts marker == \"2849\" over a stale founding-rev marker", "Seam test: a land that fails before the agent rename leaves the marker untouched": "internal/fleetland/fleetland_test.go TestLand_FailedAgentRenameLeavesMarkerUntouched — the per-arch agent dir is a file so landFile's MkdirAll fails before any rename; Land returns an error and the marker still reads founding-rev. Plus TestLand_NoAgentArtifactLeavesMarkerUntouched (no agent artifact → marker untouched) and TestRestore_PutsPreviousBinaryAndPanelBack asserts the marker rolls rev-B→rev-A on rollback" }, "summary": "The update-lane node lander now advances (and rolls back) the agent-cache RELEASE marker beside the landed agent, so /get's X-IDSS-Release names the release whose agent it actually serves.", "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#1849
No description provided.