oxidecomputer / oxidecomputer/omicron
The `sled_find_targets_query` CTE should consider local storage requests
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
Sled reservation loops over a list of sled targets returned by the sled_find_targets_query CTE, which whittles down all available sleds into a list of targets that would satisfy the VMM request., and attempts to insert the sled resources record in sled_insert_resource_query. The sled_find_targets_query CTE accounts for instance affinity and anti-affinity, and the sled resources that would be consumed if the reservation succeeded. In the uncontended case the insert should succeed on the first loop iteration, and in the contended case may require multiple iterations.
If there are local storage allocations to perform as well, this currently occurs in the sled_insert_resource_query CTE, but the sled_find_targets_query is not aware of them and will not whittle the list of available sleds down accordingly. This results in that CTE returning sled targets that may not be valid but will be tried anyway.
Change the sled_find_targets_query CTE to be aware of what local storage allocations need to be performed.
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 by tracing the sled reservation loop and compare the sled_find_targets_query CTE with sled_insert_resource_query. Determine which local storage allocations are performed during insertion, then update target selection so it excludes sleds that cannot satisfy them; done means invalid targets are no longer returned for those reservations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100