Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[reconfigurator] BlueprintBuilder cleanup 4/5 - when choosing a zpool, it must be from a disk present in the blueprint #7106

Merged
merged 12 commits into from
Nov 22, 2024

Conversation

jgallagher
Copy link
Contributor

Builds and is staged on top of #7105.

The intended change here is in the first commit (8274174): In BlueprintBuilder::sled_select_zpool(), instead of only looking at the PlanningInput, we also look at the disks present in the blueprint, and only select a zpool that the planning input says is in service and that we have in the blueprint.

This had a surprisingly-large blast radius in terms of tests - we had many tests which were adding zones (which implicitly selects a zpool) from a BlueprintBuilder where there were no disks configured at all, causing them to emit invalid blueprints. These should all be fixed as of this PR, but I'm a little worried about test fragility in general, particularly with an eye toward larger changes like #7078. Nothing to do about that at the moment, but something to keep an eye on.

Fixes #7079.

Comment on lines -826 to -829
// NOTE: We'll probably need to actually add disks here
// when the Blueprint contains "which disks back zones".
//
// However, for now, this isn't necessary.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this, the way you've done so makes a ton of sense

Comment on lines +1042 to +1044
// TODO Should we know the dataset kind from inventory? We could
// probably infer it from the name, but yuck.
kind: None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I didn't do this already, because I did not want inventory collection to fail if we see a dataset with a new "kind" value. So I can't actually map this directly to a DatasetKind value without having an Unknown variant, or without treating it as an optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this not fall under the nexus -> sled-agent API compatibility?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it could? I don't know if this is a rational concern, but the scope of inventory feels a little more like it could be arbitrary than other more-structured aspects of the API. For example, I wanted to ensure that "regardless of what shows up within hardware / datasets / etc, we can return something reasonable back to Nexus".

Basically, if it was possible for a "new, arbitrary dataset" to show up, I would still want that to be reportable through inventory, as much as possible -- even if Nexus can't request such a dataset, because it isn't a part of the strongly-typed Nexus -> Sled Agent API.

sled-agent/src/sim/storage.rs Show resolved Hide resolved
@@ -1220,8 +1220,49 @@ stdout:
blueprint ......<REDACTED_BLUEPRINT_ID>.......
parent: <none>

!..........<REDACTED_UUID>...........
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, it is nice to get rid of this!

Base automatically changed from john/reconfigurator-storage-3 to main November 21, 2024 18:14
@jgallagher jgallagher force-pushed the john/reconfigurator-storage-4 branch from a0c5837 to f3652cc Compare November 21, 2024 18:19
@andrewjstone andrewjstone merged commit 75e4448 into main Nov 22, 2024
16 checks passed
@andrewjstone andrewjstone deleted the john/reconfigurator-storage-4 branch November 22, 2024 16:27
jgallagher added a commit that referenced this pull request Nov 25, 2024
… ensure_zone_multiple_* to add_zone_* (#7107)

All of the callers of the `ensure_zone_multiple_*` methods to add
discretionary zones were, in practice, wanting to _add_ a specific
number of zones. This rewords all of those methods to be imperative,
allowing us to remove a pretty significant chunk of now-unnecessary
checks and logic.

Builds on and is staged on top of #7106.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[reconfigurator] Selecting a zpool for new zones only looks at PlanningInput, not disks in the blueprint
3 participants