oxidecomputer / oxidecomputer/omicron
current_sec should not be Option<T> for a saga
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
Currently, we dance around the possibility of an empty current_sec when dealing with sagas. This field should never be NULL, but our schema currently allows this.
From a comment on https://github.com/oxidecomputer/omicron/pull/10602
For what it's worth, I believe this cannot be None. I think the schema allowed for that because we thought we might use it to deal with failover, but I don't think we ever did.
Ideally, we would want this field to not be nullable. We would need to have some way to handle the migration to account for a random saga out there with current_sec IS NULL.
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 the saga schema and current_sec usages, then read the migration discussion in pull request #10602, especially the notes about handling existing NULL values. Done means current_sec is no longer nullable in the schema and the migration accounts for any existing saga rows with current_sec IS NULL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, databases
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100