You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blueprint: Merge the four maps keyed by sled ID into a single map (#7652)
Sorry for the size of this PR. Most of the bulk of the diff is made up
of mechanical changes to tests; I don't think there's a way to split
this up any smaller. If you ignore whitespace that will trim a few
hundred lines off the diff.
This PR should make zero behavioral changes. The main thrust of the PR
is to replace the four maps in `Blueprint` (`sled_state`,
`blueprint_zones`, `blueprint_disks`, `blueprint_datasets`) with a
single map containing the config for each sled (`sleds:
BTreeMap<SledUuid, BlueprintSledConfig>`). Only one expectorate file
changed (and that's because I changed the test; it was previously doing
a thing we can't do anymore with the combined maps).
Nontrivial fallout from this change:
* `BlueprintBuilder` no longer has to do work to ingest a parent
blueprint where sleds present in `blueprint_zones` were missing in one
or more of the other three maps.
* ... but `nexus-db-model` has to do that work now instead, to allow us
to continue to load old blueprints from the db that didn't require all
four maps to have consistent keys. We should be able to drop this and
instead `bail!` after R14, since upgrading to that release will involve
creating a blueprint that uses this combined map (and thus guarantees
the blueprint in the db has entries for all its fields).
* `blippy` got to delete several checks that are now statically
impossible.
* The blueprint diff implementation similarly got to delete a bunch of
summary fields that were complicated to construct; the `daft` output
from the `sleds` map is now directly usable in place of all those
summary fields.
I think this is pretty clearly a win, but there are a couple places
where users of blueprints or diffs are a little uglier IMO:
* Tests that were constructing a blueprint that only cared about one of
the four maps now have to fill in the full `sleds` map. This is
straightforward and mechanical, but is a little noisy.
* The executor library had substeps that took the individual maps as
arguments. Those maps no longer exist, so I changed them to take
iterators instead. This was also straightforward and mechanical, but
even more noisy.
* Using the blueprint `summary.diff.sleds` directly in tests instead of
the old summary sets is more verbose. (Personally I prefer this change,
despite the verbosity, because I found it easier to look at `daft`'s
docs then remember what all the helper methods in the diff summary did.
But I could see others feeling differently.)
Fixes#7078. After this change, it'll be possible to start work on #7309
(merging the disks/datasets/zone sled-agent endpoints into one), since
this restructuring will allow us to tag the combined config with a
single generation.
0 commit comments