Skip to content

Commit

Permalink
[reconfigurator] Fix DatasetsEditor internal zpool,kind -> ID map (#7216
Browse files Browse the repository at this point in the history
)

Blueprint zones don't contain explicit dataset IDs (yet; see #7214), so
`DatasetsEditor` maintained an internal cache mapping `(zpool, kind) ->
dataset ID`. However, that mapping is only unique for _in service_
datasets, and `DatasetsEditor` was erroneously trying to build it for
_all_ datasets (both in-service and expunged).

This PR adds a few property tests and fixes for the maintenance of this
cache, and should ensure that we only try to maintain the "at most one
dataset of a given kind on a given zpool" map for in-service datasets.
  • Loading branch information
jgallagher authored Dec 9, 2024
1 parent 836deb3 commit 2568a2e
Show file tree
Hide file tree
Showing 4 changed files with 489 additions and 102 deletions.
1 change: 1 addition & 0 deletions common/src/api/internal/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ pub struct ExternalIpGatewayMap {

/// Describes the purpose of the dataset.
#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Hash, EnumCount)]
#[cfg_attr(feature = "testing", derive(test_strategy::Arbitrary))]
pub enum DatasetKind {
// Durable datasets for zones
Cockroach,
Expand Down
1 change: 1 addition & 0 deletions nexus/reconfigurator/planning/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ omicron-workspace-hack.workspace = true
[dev-dependencies]
expectorate.workspace = true
maplit.workspace = true
omicron-common = { workspace = true, features = ["testing"] }
omicron-test-utils.workspace = true
proptest.workspace = true
test-strategy.workspace = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Seeds for failure cases proptest has generated in the past. It is
# automatically read and these particular cases re-run before any
# novel cases are generated.
#
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc a3c842ed34d27e4c78fb52fd718cfcc038942eca49672c53e126a1062f5db3ac # shrinks to input = _ProptestNamefixmeArgs { values: [[Cockroach]] }
Loading

0 comments on commit 2568a2e

Please sign in to comment.