Update Storage Model
This page documents self-update persistence in JetStream KV and Object Store.
Buckets and Object Store
Source of truth: pkg/bus/kv.go.
| Storage | Name | Key Pattern | TTL | History |
|---|---|---|---|---|
| KV | update-manifests | <component>.<goos>.<goarch>.<version> | none | 5 |
| KV | update-status | <component>.<id> | 60s | 1 |
| KV | update-rollouts | <rollout-id> | none | 10 |
| Object Store | update-binaries | <component>/<goos>/<goarch>/<version> | 30 days | n/a |
Manifest Schema
Source of truth: pkg/update/manifest.go.
Manifest fields:
versioncomponentgoosgoarchsha256sizeobject_keypublishedpublisher
Key helpers:
- Manifest KV key:
<component>.<goos>.<goarch>.<version> - Binary object key:
<component>/<goos>/<goarch>/<version>
Binary Integrity
Binary integrity is verified twice:
- Upload: SHA-256 is computed and stored in manifest.
- Download: object bytes are hashed and matched against expected digest before staging.
Rollout State Persistence
Source of truth: pkg/update/rollout.go.
- Rollout state is stored as one KV entry per rollout ID.
- Save semantics:
- first write: KV
Create(revision 0 -> new revision) - subsequent writes: KV
Updatewith last revision (CAS)
- first write: KV
- CAS prevents concurrent stale writers from silently overwriting rollout state.
Node Status Persistence
Source of truth: pkg/update/status.go.
- Watchdog reporter periodically writes
NodeStatustoupdate-status. - Entry expiry (60s TTL) naturally drops offline nodes from active status lists.
- Rollout controller uses these entries to infer node platform (
goos/goarch) and select matching manifests.
Operational Notes
update-statusis ephemeral by design (heartbeat-like signal).update-rolloutsretains progress/history until manually purged.update-binarieshas bounded retention (30 days); keep manifests aligned with available objects.