-
Notifications
You must be signed in to change notification settings - Fork 43
[sled-agent] Integrate config-reconciler #8064
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -17,6 +17,7 @@ use nexus_sled_agent_shared::inventory::Inventory; | |||||||||||||||||||
use nexus_sled_agent_shared::inventory::InventoryDataset; | ||||||||||||||||||||
use nexus_sled_agent_shared::inventory::InventoryDisk; | ||||||||||||||||||||
use nexus_sled_agent_shared::inventory::InventoryZpool; | ||||||||||||||||||||
use nexus_sled_agent_shared::inventory::OmicronSledConfig; | ||||||||||||||||||||
use nexus_sled_agent_shared::inventory::OmicronZonesConfig; | ||||||||||||||||||||
use nexus_sled_agent_shared::inventory::SledRole; | ||||||||||||||||||||
use nexus_types::deployment::ClickhousePolicy; | ||||||||||||||||||||
|
@@ -353,7 +354,7 @@ impl SystemDescription { | |||||||||||||||||||
!self.sleds.is_empty() | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
/// Set Omicron zones for a sled. | ||||||||||||||||||||
/// Set Omicron config for a sled. | ||||||||||||||||||||
/// | ||||||||||||||||||||
/// The zones will be reported in the collection generated by | ||||||||||||||||||||
/// [`Self::to_collection_builder`]. | ||||||||||||||||||||
|
@@ -362,17 +363,26 @@ impl SystemDescription { | |||||||||||||||||||
/// | ||||||||||||||||||||
/// # Notes | ||||||||||||||||||||
/// | ||||||||||||||||||||
/// It is okay to call `sled_set_omicron_zones` in ways that wouldn't | ||||||||||||||||||||
/// It is okay to call `sled_set_omicron_config` in ways that wouldn't | ||||||||||||||||||||
/// happen in production, such as to test illegal states. | ||||||||||||||||||||
pub fn sled_set_omicron_zones( | ||||||||||||||||||||
pub fn sled_set_omicron_config( | ||||||||||||||||||||
&mut self, | ||||||||||||||||||||
sled_id: SledUuid, | ||||||||||||||||||||
omicron_zones: OmicronZonesConfig, | ||||||||||||||||||||
sled_config: OmicronSledConfig, | ||||||||||||||||||||
) -> anyhow::Result<&mut Self> { | ||||||||||||||||||||
let sled = self.sleds.get_mut(&sled_id).with_context(|| { | ||||||||||||||||||||
format!("attempted to access sled {} not found in system", sled_id) | ||||||||||||||||||||
})?; | ||||||||||||||||||||
Arc::make_mut(sled).inventory_sled_agent.omicron_zones = omicron_zones; | ||||||||||||||||||||
let sled = Arc::make_mut(sled); | ||||||||||||||||||||
// TODO this inventory needs to be more robust for the reconciler; | ||||||||||||||||||||
// this is nontrivial so coming in a subsequent PR. For now just | ||||||||||||||||||||
Comment on lines
+377
to
+378
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super-nit, link to PR, so this comment doesn't get lost? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR isn't open yet, so hard to link. 😅 However, I put a stub in RSS on this branch where we need the updated inventory: omicron/sled-agent/src/rack_setup/service.rs Lines 426 to 434 in abd7542
which guarantees this PR can't pass the |
||||||||||||||||||||
// backfill the existing inventory structure. | ||||||||||||||||||||
sled.inventory_sled_agent.omicron_zones = OmicronZonesConfig { | ||||||||||||||||||||
generation: sled_config.generation, | ||||||||||||||||||||
zones: sled_config.zones.into_iter().collect(), | ||||||||||||||||||||
}; | ||||||||||||||||||||
sled.inventory_sled_agent.omicron_physical_disks_generation = | ||||||||||||||||||||
sled_config.generation; | ||||||||||||||||||||
Ok(self) | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
|
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.
Are you expecting that inventory will supplant this info? Or are you planning on replacing this access to the sled agent later?
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 expecting that inventory would supplant this. (I think maybe it already has, in practice? I definitely only look at inventory when I'm curious about zpools; I don't think I've ever used these omdb subcommands.)