-
Notifications
You must be signed in to change notification settings - Fork 40
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
Remove ip and port columns from dataset table #7210
Comments
This is a pre-requisite for #6998 |
After reading more code and thinking through this, I have changed the implementation plan. Our goal is to remove The address for the dataset is filled in by the reconfigurator and comes from the crucible zone associated with the dataset. Datasets map to a specific zone and are currently not relocated across zones. It's unclear if we'll ever want to do this, and it's somewhat irrelevant for the discussion at hand. So what we really want is for region allocation to be able to find the zone associated with the dataset that it has chosen for the region. Then the IP address the region will use will come from the zone and not from the dataset. Now how can we find the zone associated with a dataset so that a region can use the right address? Well, that information already exists in the target blueprint. We can loop through all the crucible zones and then find the dataset that matches and return its IP. We may want to add an index for this. Alternatively, we could put a backpointer to the Ok, that solves how we find the IP address for a region, but what about the port? Well, AFAICT, the port isn't actually used from the dataset table, as it couldn't be, since multiple downstairs share a dataset. The ports already exist in the region table and we'll continue to use those. |
FWIW I like the idea of using the blueprint to access this information -- we'd need to check that the blueprint we're reading is "still the target" in whatever allocation database requests we make, but that feels like a more reasonable source-of-truth than the raw The address/port information existing in the |
Yes, I think serializability should give us this if we read the current target blueprint table in a transaction. |
You may be interested in this helper: omicron/nexus/db-queries/src/db/datastore/deployment.rs Lines 112 to 119 in e73a30e
|
Interesting. Thanks! |
These columns are optional and only used by crucible. This makes working with datasets trickier than need be - doubly so for those that don't know these columns are only used by crucible.
It also looks like the port itself is not actually used and instead the port in the
region
table is used. Regions map 1:1 with datasets and so we should move theip
column to the region table and remove the columns from thedataset
table. It should be reasonably straightforward to do this in schema migration. Then we'll update the code to point to region table.The text was updated successfully, but these errors were encountered: