Skip to content

Commit 915f229

Browse files
authored
[reconfigurator] remove the add-zones-with-mupdate-override planner config (#10462)
While attempting to resolve #10420, we realized that the add-zones-with-mupdate-override config simply cannot result in a blueprint with coherent semantics in some cases. Concretely, consider the situation where: * a target release has been set at least twice (so both the old and new image sources are `Artifact`) * a mupdate override is present on at least one sled * there is a missing Nexus zone (which is a discretionary zone) If this planner config is set, we would attempt to place a Nexus zone on one of the sleds. What version should it have? * Currently, this is either the old `Artifact` image source or the new one. * If we decide to place the zone on the sled with a mupdate override, then that produces a blueprint that both blippy and Sled Agent (for that sled) reject. * But it would be very strange for the image source of the zone to be _different_ based on the sled it is put on. This planner config was not used in practice (documentation for our support team has no mention of it). I've left the infrastructure to add new planner configs in place, though -- happy to remove that as well if y'all feel like that makes sense. (Previously daft would not handle empty structs properly -- as part of this PR I've fixed that.) This has no impact on racks that have never have a target release set -- for those racks, the image source is always `InstallDataset` so this is moot (and pre-existing code handles the "target release generation is one" case already). Fixes #10420.
1 parent 0454090 commit 915f229

34 files changed

Lines changed: 119 additions & 1245 deletions

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ crucible-common = { git = "https://github.com/oxidecomputer/crucible", rev = "71
484484
# NOTE: See above!
485485
csv = "1.3.1"
486486
curve25519-dalek = "4"
487-
daft = { version = "0.1.4", features = ["derive", "newtype-uuid1", "oxnet01", "uuid1"] }
487+
daft = { version = "0.1.7", features = ["derive", "newtype-uuid1", "oxnet01", "uuid1"] }
488488
display-error-chain = "0.2.2"
489489
omicron-ddm-admin-client = { path = "clients/ddm-admin-client" }
490490
datatest-stable = "0.3.2"

dev-tools/omdb/src/bin/omdb/nexus/reconfigurator_config.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ pub struct ReconfiguratorConfigOpts {
5050
#[clap(long, action = ArgAction::Set)]
5151
planner_enabled: Option<bool>,
5252

53-
#[clap(long, action = ArgAction::Set)]
54-
add_zones_with_mupdate_override: Option<bool>,
55-
5653
#[clap(long, action = ArgAction::Set)]
5754
tuf_repo_pruner_enabled: Option<bool>,
5855
}
@@ -65,13 +62,7 @@ impl ReconfiguratorConfigOpts {
6562
planner_enabled: self
6663
.planner_enabled
6764
.unwrap_or(current.planner_enabled),
68-
planner_config: PlannerConfig {
69-
add_zones_with_mupdate_override: self
70-
.add_zones_with_mupdate_override
71-
.unwrap_or(
72-
current.planner_config.add_zones_with_mupdate_override,
73-
),
74-
},
65+
planner_config: PlannerConfig::default(),
7566
tuf_repo_pruner_enabled: self
7667
.tuf_repo_pruner_enabled
7768
.unwrap_or(current.tuf_repo_pruner_enabled),

dev-tools/omdb/src/bin/omdb/reconfigurator.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ async fn cmd_reconfigurator_config_history(
420420
struct SwitchesRow {
421421
version: String,
422422
planner_enabled: String,
423-
add_zones_with_mupdate_override: String,
424423
tuf_repo_pruner_enabled: String,
425424
time_modified: String,
426425
}
@@ -433,17 +432,14 @@ async fn cmd_reconfigurator_config_history(
433432
config:
434433
ReconfiguratorConfig {
435434
planner_enabled,
436-
planner_config:
437-
PlannerConfig { add_zones_with_mupdate_override },
435+
planner_config: PlannerConfig {},
438436
tuf_repo_pruner_enabled,
439437
},
440438
time_modified,
441439
} = s;
442440
SwitchesRow {
443441
version: version.to_string(),
444442
planner_enabled: planner_enabled.to_string(),
445-
add_zones_with_mupdate_override:
446-
add_zones_with_mupdate_override.to_string(),
447443
tuf_repo_pruner_enabled: tuf_repo_pruner_enabled.to_string(),
448444
time_modified: time_modified.to_string(),
449445
}

dev-tools/omdb/tests/successes.out

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,8 +2164,6 @@ Reconfigurator config:
21642164
modified time: <REDACTED_TIMESTAMP>
21652165
tuf repo pruner enabled: true
21662166
planner enabled: false
2167-
planner config:
2168-
add zones with mupdate override: false
21692167
---------------------------------------------
21702168
stderr:
21712169
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
@@ -2245,21 +2243,6 @@ stdout:
22452243
reconfigurator config updated to version 2:
22462244
tuf repo pruner enabled: true (unchanged)
22472245
* planner enabled::::::::: false -> true
2248-
planner config:
2249-
add zones with mupdate override: false (unchanged)
2250-
---------------------------------------------
2251-
stderr:
2252-
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
2253-
=============================================
2254-
EXECUTING COMMAND: omdb ["-w", "nexus", "reconfigurator-config", "set", "--add-zones-with-mupdate-override", "true"]
2255-
termination: Exited(0)
2256-
---------------------------------------------
2257-
stdout:
2258-
reconfigurator config updated to version 3:
2259-
tuf repo pruner enabled: true (unchanged)
2260-
planner enabled::::::::: true (unchanged)
2261-
planner config:
2262-
* add zones with mupdate override: false -> true
22632246
---------------------------------------------
22642247
stderr:
22652248
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
@@ -2269,12 +2252,10 @@ termination: Exited(0)
22692252
---------------------------------------------
22702253
stdout:
22712254
Reconfigurator config:
2272-
version: 3
2255+
version: 2
22732256
modified time: <REDACTED_TIMESTAMP>
22742257
tuf repo pruner enabled: true
22752258
planner enabled: true
2276-
planner config:
2277-
add zones with mupdate override: true
22782259
---------------------------------------------
22792260
stderr:
22802261
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/

dev-tools/omdb/tests/test_all_output.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,6 @@ async fn test_omdb_success_cases() {
290290
"--planner-enabled",
291291
"true",
292292
],
293-
&[
294-
"-w",
295-
"nexus",
296-
"reconfigurator-config",
297-
"set",
298-
"--add-zones-with-mupdate-override",
299-
"true",
300-
],
301293
&["nexus", "reconfigurator-config", "show", "current"],
302294
&["reconfigurator", "export", tmppath.as_str()],
303295
// We can't easily test the sled agent output because that's only

dev-tools/reconfigurator-cli/src/lib.rs

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use anyhow::{Context, anyhow, bail, ensure};
88
use camino::Utf8PathBuf;
99
use chrono::{DateTime, Utc};
10-
use clap::{ArgAction, ValueEnum};
10+
use clap::ValueEnum;
1111
use clap::{Args, Parser, Subcommand};
1212
use daft::Diffable;
1313
use gateway_types::rot::RotSlot;
@@ -34,6 +34,7 @@ use nexus_reconfigurator_simulation::{
3434
};
3535
use nexus_reconfigurator_simulation::{SimStateBuilder, SimTufRepoSource};
3636
use nexus_reconfigurator_simulation::{SimTufRepoDescription, Simulator};
37+
use nexus_types::deployment::BlueprintHostPhase2DesiredContents;
3738
use nexus_types::deployment::BlueprintMeasurements;
3839
use nexus_types::deployment::CockroachDbSettings;
3940
use nexus_types::deployment::ExpectedVersion;
@@ -42,9 +43,6 @@ use nexus_types::deployment::execution::blueprint_internal_dns_config;
4243
use nexus_types::deployment::{Blueprint, UnstableReconfiguratorState};
4344
use nexus_types::deployment::{BlueprintArtifactVersion, PendingMgsUpdate};
4445
use nexus_types::deployment::{BlueprintExpungedZoneAccessReason, execution};
45-
use nexus_types::deployment::{
46-
BlueprintHostPhase2DesiredContents, PlannerConfig,
47-
};
4846
use nexus_types::deployment::{BlueprintSource, SledFilter};
4947
use nexus_types::deployment::{
5048
BlueprintZoneImageSource, PendingMgsUpdateDetails,
@@ -1554,8 +1552,6 @@ enum SetArgs {
15541552
/// TUF repo containing release artifacts
15551553
filename: Utf8PathBuf,
15561554
},
1557-
/// planner config
1558-
PlannerConfig(SetPlannerConfigArgs),
15591555
/// timestamp for ignoring impossible MGS updates
15601556
IgnoreImpossibleMgsUpdatesSince {
15611557
since: SetIgnoreImpossibleMgsUpdatesSinceArgs,
@@ -1581,35 +1577,6 @@ impl FromStr for SetIgnoreImpossibleMgsUpdatesSinceArgs {
15811577
}
15821578
}
15831579

1584-
#[derive(Debug, Args)]
1585-
struct SetPlannerConfigArgs {
1586-
#[clap(flatten)]
1587-
planner_config: PlannerConfigOpts,
1588-
}
1589-
1590-
// Define the config fields separately so we can use `group(required = true,
1591-
// multiple = true).`
1592-
#[derive(Debug, Clone, Args)]
1593-
#[group(required = true, multiple = true)]
1594-
pub struct PlannerConfigOpts {
1595-
#[clap(long, action = ArgAction::Set)]
1596-
add_zones_with_mupdate_override: Option<bool>,
1597-
}
1598-
1599-
impl PlannerConfigOpts {
1600-
fn update_if_modified(
1601-
&self,
1602-
current: &PlannerConfig,
1603-
) -> Option<PlannerConfig> {
1604-
let new = PlannerConfig {
1605-
add_zones_with_mupdate_override: self
1606-
.add_zones_with_mupdate_override
1607-
.unwrap_or(current.add_zones_with_mupdate_override),
1608-
};
1609-
(new != *current).then_some(new)
1610-
}
1611-
}
1612-
16131580
#[derive(Debug, Args)]
16141581
struct SetCockroachdbSettingsArgs {
16151582
#[clap(flatten)]
@@ -3542,17 +3509,6 @@ fn cmd_set(
35423509
);
35433510
format!("set target release based on {}", filename)
35443511
}
3545-
SetArgs::PlannerConfig(args) => {
3546-
let current = state.system_mut().description().get_planner_config();
3547-
if let Some(new) = args.planner_config.update_if_modified(&current)
3548-
{
3549-
state.system_mut().description_mut().set_planner_config(new);
3550-
let diff = current.diff(&new);
3551-
format!("planner config updated:\n{}", diff.display())
3552-
} else {
3553-
format!("no changes to planner config:\n{}", current.display())
3554-
}
3555-
}
35563512
SetArgs::IgnoreImpossibleMgsUpdatesSince { since } => {
35573513
state
35583514
.system_mut()

dev-tools/reconfigurator-cli/tests/input/cmds-add-zones-with-mupdate-override.txt

Lines changed: 0 additions & 48 deletions
This file was deleted.

dev-tools/reconfigurator-cli/tests/input/cmds-example.txt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ inventory-show latest all
5959
blueprint-plan latest
6060
blueprint-diff ade5749d-bdf3-4fab-a8ae-00bea01b3a5a latest
6161

62-
# Set planner config.
63-
set planner-config --add-zones-with-mupdate-override false
64-
set planner-config --add-zones-with-mupdate-override true
65-
set planner-config --add-zones-with-mupdate-override true
66-
6762
# Sled index out of bounds, will error out.
6863
wipe all
6964
load-example --seed test-basic --nsleds 3 --sled-policy 3:non-provisionable
@@ -72,15 +67,15 @@ log
7267
log --verbose
7368

7469
# Switch states with a full UUID.
75-
switch 4d8d6725-1ae3-4f88-b9cb-a34db82d7439
70+
switch 4a3b153b-fc8a-485a-baee-badaad53d2fc
7671
log
7772

7873
# Switch states with a unique prefix.
79-
switch 860f
74+
switch 0a3
8075
log
8176

8277
# Switch states with an ambiguous prefix (should fail).
83-
switch 4
78+
switch 2
8479

8580
# Switch states with a non-existent prefix (should fail).
8681
switch zzzz
@@ -90,11 +85,11 @@ sled-add
9085
sled-add
9186

9287
# Make an additional branch based on the previous branch.
93-
switch 4d8d6725
88+
switch 860f
9489
sled-add
9590

9691
# Go back to the previous branch.
97-
switch 5c53cf4b
92+
switch 4d8d6725
9893

9994
log
10095
log --verbose

dev-tools/reconfigurator-cli/tests/input/cmds-expunge-newly-added-external-dns.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ blueprint-diff 3f00b694-1b16-4aaa-8f78-e6b3a527b434 366b0b68-d80e-4bc1-abd3-dc69
1010

1111
blueprint-show 366b0b68-d80e-4bc1-abd3-dc69837847e0
1212

13-
# Set the add_zones_with_mupdate_override planner config to ensure that zone
14-
# adds happen despite zone image sources not being Artifact.
15-
set planner-config --add-zones-with-mupdate-override true
16-
1713
# blueprint-plan will place a new external DNS zone, diff DNS to see the new zone has `ns<N>` and NS records.
1814
blueprint-plan 366b0b68-d80e-4bc1-abd3-dc69837847e0
1915
blueprint-diff 366b0b68-d80e-4bc1-abd3-dc69837847e0 9c998c1d-1a7b-440a-ae0c-40f781dea6e2

0 commit comments

Comments
 (0)