oxidecomputer / oxidecomputer/omicron

current_sec should not be Option<T> for a saga

Open
#10,848 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.