Skip to content

[29/n] [reconfigurator] separate out noop image source decision making #8596

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

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Jul 15, 2025

While working on #8572, we realized that we need to put in a condition saying that if any zones can't be switched over to Artifact, we must not clear the mupdate override field. This effectively requires information about eligibility to be available in two spots: while updating the mupdate override, and while doing these noop conversions.

In order to do that more easily, this PR builds up a decision tree by sled.

Created using spr 1.3.6-beta.1
@sunshowers sunshowers changed the title [reconfigurator] separate out noop image source decision making [29/n] [reconfigurator] separate out noop image source decision making Jul 15, 2025
Created using spr 1.3.6-beta.1
@sunshowers sunshowers requested a review from jgallagher July 15, 2025 17:28
version,
hash,
} => {
return NoopConvertZoneInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

Small style nit - maybe move this closure to its own function? I sometimes have a hard time a return at this point doesn't return from the method as a whole.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Comment on lines 282 to 287
// A sled is eligible for conversion if the mupdate_override_id is None
//
// The code is structured in this manner because the planner's mupdate
// override step requires access to the sled's zones, and is responsible for
// clearing this field if it also clears the mupdate override in the
// blueprint.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my own understanding: We're going to return this to do_plan. Currently it hands it off to do_plan_noop_image_source(), which has to inspect mupdate_override_id to know whether to consider the contents of zones. But in the future, do_plan will first give this to the mupdate override clear step, which may set this to None, right?

I'm trying to figure out if there's a way to get rid of the Maybe here, so do_plan_noop_image_source() doesn't have to make decisions on its own (and because I think it'd be easier to understand if we only had "eligible" and "ineligible"). This might be nonsense, but based on my understanding above, could we:

  • make this module return the sled as ineligible with NoopConvertSledIneligibleReason::MupdateOverride(MupdateOverrideUuid) if there's a mupdate override in place
  • if there's no mupdate override in place, return NoopConvertSledStatus::Eligible (basically the same as what we have, but dropping all the Maybes)
  • in the future, have the mupdate override clear step convert from NoopConvertSledIneligibleReason::MupdateOverride(MupdateOverrideUuid) to NoopConvertSledStatus::Eligible if it's able to clear the mupdate override?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the "maybe" is a bit of a wart -- let me see if I can make this easier to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simplified it down to eligible and ineligible, but retained the zone map with the MupdateOverride case to enable easier state conversions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, makes sense. Looks great, thanks!

Created using spr 1.3.6-beta.1
@sunshowers sunshowers enabled auto-merge (squash) July 15, 2025 20:14
@sunshowers sunshowers merged commit 509eab5 into main Jul 16, 2025
17 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/reconfigurator-separate-out-noop-image-source-decision-making branch July 16, 2025 00:00
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.

2 participants