-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nexus] move dataset IDs to TypedUuid #5532
[nexus] move dataset IDs to TypedUuid #5532
Conversation
Created using spr 1.3.6-beta.1
Is this true? I thought a zone could have 0 or more datasets. Today it looks like it's "0 or exactly 1", and if 1, the dataset ID does match the zone ID, but I'm not sure it will always be that way? |
Oh interesting, I didn't realize that. Thoughts on how this should be represented then? I feel like we should use an enum that covers both the N = 1 and N = many cases. |
My gut feeling is that this should just be a |
Yeah, I believe that right now, there is at most one dataset associated with each zone. And you know based on the zone type whether it has one. In principle we could have more datasets later, but that's pretty hypothetical and I think it's a pretty useful simplification for the time being that the zone id == dataset id. That's especially useful when debugging. I'd be inclined not to frontload the work now to generalize this for something that we don't know whether/when/why we'll do later. I also think it makes sense to use a separate type like Forking diesel sounds pretty extreme. There's a whole ecosystem of crates related to it and I think we also want to be able to take new updates to it pretty easily. |
I'm okay with that, I think.
Oh I was imagining just a patchset on top that we'd use a |
Made a post on the Diesel discussion board about this, diesel-rs/diesel#3993 -- hoping to have Diesel take in optional support for newtype-uuid, which will solve this problem. |
We'll have to do this from scratch -- going to abandon this and come back to it when I have more time. |
Datasets are zones, so they're
OmicronZoneUuid
instances. Was quitestraightforward in the end.
There is some messiness around Diesel, and honestly I'm half-tempted to just
fork and publish our own version of Diesel, with support for typed UUIDs +
other things we've run into.