Skip to content

Commit

Permalink
[reconfigurator] Fix DatasetsEditor internal zpool,kind -> ID map
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 committed Dec 6, 2024
1 parent e73a30e commit 804e09e
Show file tree
Hide file tree
Showing 3 changed files with 425 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
Loading

0 comments on commit 804e09e

Please sign in to comment.