-
Notifications
You must be signed in to change notification settings - Fork 43
[inventory] Add full OmicronSledConfig
and fields for upcoming config reconciler
#8188
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
[inventory] Add full OmicronSledConfig
and fields for upcoming config reconciler
#8188
Conversation
Just went through an upgrade to this branch on dublin. After the mupdate, while Nexus is blocked waiting for schema migrations, we had a few collections from before the update:
After performing the schema migration, all of them were removed (as expected). About 2 minutes later, the first post-upgrade collection showed up. (I think from watching Nexus logs, most of that 2 minutes was in Nexus's backoff waiting for the schema migration.) This is what the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(partway through reviewing)
@@ -196,6 +197,18 @@ pub struct OmicronSledConfig { | |||
pub remove_mupdate_override: Option<MupdateOverrideUuid>, | |||
} | |||
|
|||
impl Default for OmicronSledConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on deriving this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that would require Generation
to impl Default
, which it currently does not. I can't think of a reason why it shouldn't, but will ask around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generated a lot of discussion. 😅 Generation
not implementing Default
is intentional, so I'll leave this as-is.
@@ -851,6 +859,158 @@ impl DataStore { | |||
} | |||
} | |||
|
|||
// Insert rows for the all the sled configs we found. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deeply admire your tenacity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is absolutely incredible work.
Accepting modulo a few comments.
@@ -0,0 +1,2 @@ | |||
ALTER TABLE omicron.public.inv_sled_agent | |||
ADD COLUMN IF NOT EXISTS reconciler_status_kind inv_config_reconciler_status_kind NOT NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to set a default value (not-yet-run?) in this migration, and then remove the default in a future one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was worried it might, but it doesn't, because we've explicitly removed all the rows from inv_sled_agent
in up01.sql
.
@@ -0,0 +1,13 @@ | |||
CREATE TABLE IF NOT EXISTS omicron.public.inv_omicron_sled_config_zone_nic ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess these are just copied from inv_omicron_zone_nic
etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes: a few of these "new" tables are really the old table with a new column, except that new column is part of the primary key. I think it's easier to reason about the migration as "drop the table, recreate the new table" instead of having to deal with migrating the primary key indices.
…g-reconciler-inventory-integration
…g-reconciler-inventory-integration
The primary change here is replacing these inventory fields (a subset of
OmicronSledConfig
):with these:
Once #8064 lands, all three of these will be filled in meaningfully; as of this PR, only
ledgered_sled_config
is populated. (reconciler_status
is alwaysNotYetRun
andlast_reconciliation
is alwaysNone
, since there is no reconciler yet.) The rest of the changes are all fallout from changing inventory:omdb
printingledgered_sled_config
for now, but will need to be updated on [sled-agent] Integrate config-reconciler #8064 once other fields are populatedomicron_zones
to a fullOmicronSledConfig
. The first few schema migrations take care of this.Before merging I'll go through an upgrade on a racklette and confirm things come back up okay after the schema migration blows away all the pre-update inventory collections. (We think this is fine, but it'd be good to confirm.) But I think this is close enough that it's reviewable.
Couple other minor changes that came along for the ride:
inv_sled_omicron_zones
is gone now)image_source
columns to the inventory zone config table, so we don't loseImageSource::Artifact { hash }
values reported by sled-agent)