From 9f09cb82a13dee32d6443037467c6b18aa5e9585 Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Thu, 22 Aug 2024 01:10:16 +0000 Subject: [PATCH] review nits --- nexus/db-queries/src/db/datastore/cockroachdb_settings.rs | 5 +++-- nexus/src/app/rack.rs | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nexus/db-queries/src/db/datastore/cockroachdb_settings.rs b/nexus/db-queries/src/db/datastore/cockroachdb_settings.rs index 4c4be65e4a..a38cfb8935 100644 --- a/nexus/db-queries/src/db/datastore/cockroachdb_settings.rs +++ b/nexus/db-queries/src/db/datastore/cockroachdb_settings.rs @@ -164,8 +164,9 @@ mod test { assert_eq!(version, CockroachDbClusterVersion::POLICY); } else { panic!( - "`cluster.preserve_downgrade_option` should not be {:?}", - settings.preserve_downgrade + "`cluster.preserve_downgrade_option` is {:?}, + but it should be empty or \"{}\"", + settings.preserve_downgrade, version ); } diff --git a/nexus/src/app/rack.rs b/nexus/src/app/rack.rs index e5da4c2897..8d53a7abc9 100644 --- a/nexus/src/app/rack.rs +++ b/nexus/src/app/rack.rs @@ -260,8 +260,11 @@ impl super::Nexus { )?; CockroachDbClusterVersion::NEWLY_INITIALIZED } else { - // Fill in the blueprint with the current value of the option in - // the database. + // `cluster.preserve_downgrade_option` is set, so fill in the + // blueprint with the current value. This branch should never + // be hit during normal rack initialization; it's here for + // eventual test cases where `cluster.preserve_downgrade_option` + // is set by a test harness prior to rack initialization. CockroachDbClusterVersion::from_str( &cockroachdb_settings.preserve_downgrade, )