Skip to content

recovery drill#297

Merged
v0lkan merged 2 commits into
mainfrom
feat/recovery-drill
Jul 16, 2026
Merged

recovery drill#297
v0lkan merged 2 commits into
mainfrom
feat/recovery-drill

Conversation

@v0lkan

@v0lkan v0lkan commented Jul 16, 2026

Copy link
Copy Markdown
Member

No description provided.

v0lkan added 2 commits July 16, 2026 15:15
Nexus blocked in InitializeBackingStoreFromKeepers, an infinite retry
loop, before ever starting its mTLS listener. When every Keeper lost
its shard, that deadlocked the break-the-glass flow: the operator
restore endpoint is the documented way out of exactly that state, but
an un-initialized Nexus was not listening, so `spike operator restore`
had nothing to talk to. The routing layer already anticipated serving
in this state (route/base exempts the operator recover/restore
emergency routes from root-key validation and answers everything else
with "not ready"), so the listener never coming up was purely a boot
ordering bug.

Run the Keeper-based recovery in a background goroutine so main can
start the server immediately. Additionally, the recovery loop now
stands down as soon as a root key is present, so a successful operator
restore hands over to the periodic shard sync instead of polling the
Keepers forever.

Found and verified live by the new recovery drill
(hack/bare-metal/drill/recovery-drill.sh): before the fix, the drill's
shard feeds could never reach Nexus; after it, two of three shards
restore the system and a pre-crash secret reads back.

Spec: TBD
Signed-off-by: Volkan Özçelik <volkan.ozcelik@broadcom.com>
`make drill-recovery` proves the break-the-glass runbook end to end
against a running dev environment: it writes a marker secret, exports
recovery shards via `spike operator recover`, kills Nexus and all
Keepers (losing the in-memory shards), restarts Nexus alone, feeds the
shards back through `spike operator restore` over stdin, and verifies
the pre-crash secret reads back. The Pilot's SPIRE entry is rotated
through the recover and restore roles along the way, and a trap reverts
it to superuser on every exit path.

The drill retries the transient conditions it meets in practice: SVID
rotation lag after entry updates (access_unauthorized) and Nexus still
coming up (comms errors). Pilot output is captured with the streams
merged, matching the other harness scripts, because cobra's Print
family writes to stderr by default.

The drill's first runs exposed the Nexus boot-order deadlock fixed in
the previous commit, which is exactly the class of regression it exists
to catch. TASKS.md: closes the Phase 1 recovery/restore task and both
related Phase 3 items.

Spec: TBD
Signed-off-by: Volkan Özçelik <volkan.ozcelik@broadcom.com>
@v0lkan v0lkan self-assigned this Jul 16, 2026
@v0lkan
v0lkan merged commit d07b4d3 into main Jul 16, 2026
14 checks passed
@v0lkan
v0lkan deleted the feat/recovery-drill branch July 16, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant