Skip to content

Commit

Permalink
Add clickhouse_policy to PlanningInputFromDb
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjstone committed Oct 16, 2024
1 parent 556ccb7 commit add2874
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions nexus/reconfigurator/execution/src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,7 @@ mod test {
target_cockroachdb_cluster_version:
CockroachDbClusterVersion::POLICY,
target_crucible_pantry_zone_count: CRUCIBLE_PANTRY_REDUNDANCY,
clickhouse_policy: None,
log,
}
.build()
Expand Down
10 changes: 9 additions & 1 deletion nexus/reconfigurator/preparation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use nexus_db_queries::db::pagination::Paginator;
use nexus_db_queries::db::DataStore;
use nexus_types::deployment::Blueprint;
use nexus_types::deployment::BlueprintMetadata;
use nexus_types::deployment::ClickhousePolicy;
use nexus_types::deployment::CockroachDbClusterVersion;
use nexus_types::deployment::CockroachDbSettings;
use nexus_types::deployment::OmicronZoneExternalIp;
Expand Down Expand Up @@ -75,6 +76,7 @@ pub struct PlanningInputFromDb<'a> {
pub internal_dns_version: nexus_db_model::Generation,
pub external_dns_version: nexus_db_model::Generation,
pub cockroachdb_settings: &'a CockroachDbSettings,
pub clickhouse_policy: Option<ClickhousePolicy>,
pub log: &'a Logger,
}

Expand Down Expand Up @@ -138,6 +140,11 @@ impl PlanningInputFromDb<'_> {
.await
.internal_context("fetching cockroachdb settings")?;

let clickhouse_policy = datastore
.clickhouse_policy_get_latest(opctx)
.await
.internal_context("fetching clickhouse policy")?;

let planning_input = PlanningInputFromDb {
sled_rows: &sled_rows,
zpool_rows: &zpool_rows,
Expand All @@ -156,6 +163,7 @@ impl PlanningInputFromDb<'_> {
internal_dns_version,
external_dns_version,
cockroachdb_settings: &cockroachdb_settings,
clickhouse_policy,
}
.build()
.internal_context("assembling planning_input")?;
Expand All @@ -177,7 +185,7 @@ impl PlanningInputFromDb<'_> {
.target_cockroachdb_cluster_version,
target_crucible_pantry_zone_count: self
.target_crucible_pantry_zone_count,
clickhouse_policy: None,
clickhouse_policy: self.clickhouse_policy.clone(),
};
let mut builder = PlanningInputBuilder::new(
policy,
Expand Down

0 comments on commit add2874

Please sign in to comment.