oxidecomputer / oxidecomputer/omicron

Make `start_sled_agent` idempotent

Open
#4,494 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bootstrap services Sled Agent
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

Right now, there are two states when the bootstrap agent attempts to start the sled-agent: SledAgentState::Bootstrapping and SledAgentState::ServerStarted. However, to get from Bootstrapping to ServerStarted we call start_sled_agent which is fallible. For many reasons, this method cannot be safely retried. One mechanism to fix this would be to persist the StartSledAgentRequest to the ledger before doing other work and then run code based on what's in the ledger. This would also reduce the latency of adding a sled as we could return to the caller as soon as the request was persisted. It would also make the system crash safe. We handle the bootstore early network config this way, and so it's not so far out there.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with sled-agent/src/bootstrap/server.rs at start_sled_agent around line 721, then trace the Bootstrapping and ServerStarted state handling and StartSledAgentRequest. Compare this flow with the bootstore early network configuration's ledger-based handling. Done means retries are safe, the request survives crashes through ledger persistence, and callers can return after persistence.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.