oxidecomputer / oxidecomputer/omicron
Deleting external subnets is overly-complicated
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
The code for deleting external subnets looks like this:
That delegates to a custom query, which checks that the subnet isn't attached to an instance before deleting it. This is much more complicated than in needs to be. I forgot about the UpdateAndCheck trait we have for exactly this kind of conditional delete. The code is correct, but we should just use the standard mechanism.
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 in nexus/db-queries/src/db/datastore/external_subnet.rs at lines 544-565 and inspect the existing conditional-delete code and the UpdateAndCheck trait. Replace the custom query with the standard mechanism while preserving the check that prevents deletion when the subnet is attached to an instance; the existing deletion behavior should remain correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- database
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100