Failures in `request_sled_agent` may leave future requests doomed
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- rust
- Domain
- backend, networking
Research direction
Start in sled-agent/src/bootstrap/agent.rs at BootstrapAgent::request_sled_agent(), then read the callers in agent.rs and server.rs and the LRTQ initialization in secret_retriever.rs. Trace each fallible step and the subnet advertisement and server shutdown paths; done means failed requests cannot leave stale trust-quorum state, subnet advertisements, or server bindings that break later requests.
Written by the indexing model from the issue text.
Description
BootstrapAgent::request_sled_agent() is called from two places:
- In BootstrapAgent::new(), if we're just starting and there's a persistent request stored in the ledger (i.e., cold boot)
- If we receive a request on the bootstrap server
The first thing request_sled_agent does, if trust quorum is enabled is infallibly, is initialize LRTQ using a hash of the request's rack_id as a salt. This is already potentially problematic: if we have previously entered request_sled_agent() with a different rack ID, this will result in a panic.
If we're in the SledAgentState::Before case, we then proceed to attempt to set up the sled agent, which may fail at multiple steps:
- We could fail to restart the hardware monitor after we've taken it out.
- We could fail to start the sled-agent server.
- We could fail to find at least one M.2 where the ledger should be stored (outright failure here is unlikely, but we could only see one drive here - see #3815).
- We could fail to commit the ledger.
In between fallible points 1 and 2, we start advertising the subnet prefix from the request. If we fail at 2/3/4, I don't think anything unadvertises that prefix, so if we get a future request with a different request.subnet, we could end up advertising two subnets (only one of which we're actually using).
If we fail at points 3 or 4, we will drop the sled-agent server, which will attempt to close it, but we have no way (without async Drop) of waiting for that close to actually happen, so it's possible future request_sled_agent calls could fail because the old sled-agent server is still running and bound to our port.
To be clear, I think any of these causing problems in practice are pretty unlikely (or possibly impossible) given the way we currently run RSS / initialize sled-agents; I just wanted to write them down while I'm in this part of the code looking to clean things up.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
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.
More from oxidecomputer/omicron
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
oxidecomputer/omicron#11269 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
oxidecomputer/omicron#11266 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
oxidecomputer/omicron#11260 · 1 comment ·
-
wicket's errors should be better when trying to read sensitive data from ssh without a pseudo-tty Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
oxidecomputer/omicron#11148 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxidecomputer/omicron#10907 ·
All issues in oxidecomputer/omicron
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100