Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjstone committed Oct 10, 2024
1 parent c557922 commit 0af62e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions nexus/db-model/src/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ impl TryFrom<InvClickhouseKeeperMembership>
type Error = anyhow::Error;

fn try_from(value: InvClickhouseKeeperMembership) -> anyhow::Result<Self> {
let err_msg = "clickhouse keeper ID > 2^63";
let err_msg = "clickhouse keeper ID is negative";
let mut raft_config = BTreeSet::new();
for id in value.raft_config {
raft_config.insert(KeeperId(id.try_into().context(err_msg)?));
Expand All @@ -1756,7 +1756,7 @@ impl TryFrom<InvClickhouseKeeperMembership>
leader_committed_log_index: value
.leader_committed_log_index
.try_into()
.context("log index > 2^63")?,
.context("log index is negative")?,
raft_config,
})
}
Expand Down
12 changes: 6 additions & 6 deletions nexus/inventory/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const SLED_AGENT_TIMEOUT: Duration = Duration::from_secs(60);
/// Collect all inventory data from an Oxide system
pub struct Collector<'a> {
log: slog::Logger,
mgs_clients: Vec<gateway_client::Client>,
keeper_admin_clients: Vec<clickhouse_admin_client::Client>,
mgs_clients: Option<Vec<gateway_client::Client>>,
keeper_admin_clients: Option<Vec<clickhouse_admin_client::Client>>,
sled_agent_lister: &'a (dyn SledAgentEnumerator + Send + Sync),
in_progress: CollectionBuilder,
}
Expand All @@ -42,8 +42,8 @@ impl<'a> Collector<'a> {
) -> Self {
Collector {
log,
mgs_clients,
keeper_admin_clients,
mgs_clients: Some(mgs_clients),
keeper_admin_clients: Some(keeper_admin_clients),
sled_agent_lister,
in_progress: CollectionBuilder::new(creator),
}
Expand Down Expand Up @@ -77,7 +77,7 @@ impl<'a> Collector<'a> {

/// Collect inventory from all MGS instances
async fn collect_all_mgs(&mut self) {
let clients = std::mem::take(&mut self.mgs_clients);
let clients = self.mgs_clients.take().unwrap();
for client in &clients {
self.collect_one_mgs(&client).await;
}
Expand Down Expand Up @@ -375,7 +375,7 @@ impl<'a> Collector<'a> {
/// Collect inventory from about keepers from all `ClickhouseAdminKeeper`
/// clients
async fn collect_all_keepers(&mut self) {
let clients = std::mem::take(&mut self.keeper_admin_clients);
let clients = self.keeper_admin_clients.take().unwrap();
for client in &clients {
self.collect_one_keeper(&client).await;
}
Expand Down

0 comments on commit 0af62e3

Please sign in to comment.