Skip to content

typed generation numbers via oxide-generation - #11129

Merged
sunshowers merged 6 commits into
mainfrom
sunshowers/spr/rfc-typed-generation-numbers-via-oxide-generation
Aug 22, 2026
Merged

typed generation numbers via oxide-generation#11129
sunshowers merged 6 commits into
mainfrom
sunshowers/spr/rfc-typed-generation-numbers-via-oxide-generation

Conversation

@sunshowers

@sunshowers sunshowers commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

As demoed at the update watercooler yesterday (2026-08-20) -- add the oxide-generation crate and a registry of kinds, very similar to omicron-uuid-kinds.

Also port a few generation kinds over. All of our great typify automatic replacement infrastructure works very well.

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Comment on lines +710 to +712
pub use oxide_generation::{
Generation, GenerationNegativeError, GenerationOverflowError,
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are temporary re-exports -- planning to switch the code to using oxide-generation directly.

Created using spr 1.3.6-beta.1
@sunshowers
sunshowers requested review from hawkw and smklein August 21, 2026 17:19
@sunshowers sunshowers changed the title [RFC] typed generation numbers via oxide-generation typed generation numbers via oxide-generation Aug 21, 2026
@sunshowers
sunshowers marked this pull request as draft August 21, 2026 17:36
@sunshowers

Copy link
Copy Markdown
Contributor Author

Want to make a few more changes to this.

Created using spr 1.3.6-beta.1
@sunshowers
sunshowers marked this pull request as ready for review August 21, 2026 19:16
Comment thread Cargo.lock
Comment on lines +15500 to +15501
name = "syn"
version = "3.0.3"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fine, but kinda a bummer to have both syn 3 and syn 2 in the workspace at once. I think we're getting pulled forward because of the daft upgrade?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, someone's gotta be the first :)

Comment thread generation-kinds/README.adoc Outdated
]
},
"SagaReassignmentGeneration": {
"description": "Generation numbers stored in the database, used for optimistic concurrency control",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this generation number isn't getting stored in the database, it's an in-memory signal that we've caught up with recovery, but whatever. I don't know if we care enough to change this description.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I kept the doc comment for Generation the same to avoid an unnecessary rev of OpenAPI documents. Agreed that generation numbers are used in broader contexts than just database concurrency.

Created using spr 1.3.6-beta.1
@sunshowers
sunshowers enabled auto-merge (squash) August 22, 2026 20:31
@sunshowers
sunshowers merged commit 8e04289 into main Aug 22, 2026
21 checks passed
@sunshowers
sunshowers deleted the sunshowers/spr/rfc-typed-generation-numbers-via-oxide-generation branch August 22, 2026 21:22
sunshowers added a commit that referenced this pull request Aug 25, 2026
Following up from #11129, use omicron-generation-kinds as the place to
get `Generation` from.

Use omicron-generation-kinds rather than oxide-generation directly to
ensure the correct features all get enabled whenever the dep is used.
This allows oxide-generation to be dropped from the workspace hack
(since all dependencies resolve to the same set of features).
sunshowers added a commit that referenced this pull request Aug 25, 2026
Following up from #11129 and #11134.

Note that like with UUIDs we don't expose typed generations in the
external API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants