oxidecomputer / oxidecomputer/omicron
Make `start_sled_agent` idempotent
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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