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

Blueprints: store sled state #5663

Merged
merged 11 commits into from May 13, 2024
Merged

Blueprints: store sled state #5663

merged 11 commits into from May 13, 2024

Conversation

jgallagher
Copy link
Contributor

This adds the sled_state map described in RFD 457 to Blueprint. The motivating driver here is decommissioning expunged sleds, which is on the path to addressing #5625, but this PR only adds the field - the planner carries forward states from its inputs, but otherwise makes no changes, and the executor doesn't read the new field at all.

Copy link
Collaborator

@davepacheco davepacheco left a comment

Choose a reason for hiding this comment

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

I am generally skeptical of landing interfaces without consumers, but I appreciate the desire to separate changes that are separable. It might be useful to wait to land this until we've fleshed out the stuff that needs to use it but I defer to you on that!

@@ -1603,6 +1604,12 @@ mod tests {
}
}

fn sled_states_active(
Copy link
Collaborator

Choose a reason for hiding this comment

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

The repetition of this reinforces the idea that we could use a nice low-level builder interface that could take care of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought this would require some serious rework of BlueprintBuilder and the planner to make the builder less plan-y, but I was wrong (although I think there is still a lot of room for improvement there). I reworked this test to use BlueprintBuilder in 4949eac and it went pretty well. There were two spots (creating bp2 and bp4) where it was easier to clone the parent blueprint and manually poke it than to go through the builder, but it still seems like a pretty significant cleanup overall.

nexus/types/src/deployment.rs Outdated Show resolved Hide resolved
schema/crdb/blueprint-add-sled-state/up2.sql Outdated Show resolved Hide resolved
@jgallagher jgallagher merged commit f33fc84 into main May 13, 2024
21 checks passed
@jgallagher jgallagher deleted the john/blueprint-store-sled-state branch May 13, 2024 17:32
jgallagher added a commit that referenced this pull request May 13, 2024
This builds on (and is currently pointed at) #5663, and is on the path
to fixing #5625, although there is still more work to do there. (Should
be small, and I'll start on it while this is in review to make sure it
really fixes it.) I don't plan on landing this before R8 is out the
door, but wanted to go ahead and open it up to review.

Much of this is fallout from our discussions about what it means to
decommission a sled. Major changes are:

* `SledFilter::All` has been renamed to `SledFilter::Commissioned`, and
no longer returns sleds that are in `SledState::Decommissioned`.
* The blueprint planner will now update the desired sled state to
`Decommissioned` for sleds which satisfy our conditions. (See
`do_plan_decommission()`.)
* The blueprint planner will carry forward the Omicron zones of
decommissioned sleds to child blueprints. Pruning these is #5552.
* The blueprint planner will _not_ carry forward a desired sled state of
`Decommissioned` once the inputs report that the sled has already been
decommissioned.
* The blueprint executor will decommission sleds that the planner said
to.
* Decommissioning a sled implicitly decommissions all its disks. (This
matches what happens with sled expungement, and should not interfere
with region replacement, which keys off of policy, not state.)
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.

None yet

3 participants