Skip to content

BlueprintZoneDisposition::Expunged - track additional properties#7558

Merged
jgallagher merged 9 commits intomainfrom
john/blueprint-disposition-expunged-cleanup
Feb 20, 2025
Merged

BlueprintZoneDisposition::Expunged - track additional properties#7558
jgallagher merged 9 commits intomainfrom
john/blueprint-disposition-expunged-cleanup

Conversation

@jgallagher
Copy link
Copy Markdown
Contributor

The Expunged zone disposition can now also track:

  • the config generation in which the zone was expunged
  • whether we've confirmed that the zone has been shut down

Currently confirmed_shut_down is always false; the planner will fill it in to true in a subsequent PR.

While I was modifying this enum: removed the Quiesced state, which we don't use yet (and it's not clear how that will need to be represented when we get to it in the future).


The followup work to fill in confirmed_shut_down and use it in the executor is important, and I'll hold off merging this until that work is up in a PR. But I think this is far enough along that it's ready for review, and I'd like to get some eyes on it to see what we think about

a) storing cleanup eligibility in Expunged as opposed to a separate state field
b) storing the as_of_generation to help the planner know when cleanup can proceed

Storing these inside the disposition required getting rid of the blueprint_zone_disposition diesel filter (which itself relied on strum enum iteration, which isn't supported for a data-bearing variant like the new Expunged). I think this is not just okay but expected: we're saying the expunged disposition is more complex than a single column can represent. The diesel filter was to help downstream consumers of the blueprint, but we've recently changed directions there and said downstream consumers really ought to be reading rendezvous tables instead. There was only one user of the blueprint_zone_disposition filter; I changed it to just look at the disposition column directly for now, but noted it should use a rendezvous table at some point.

The `Expunged` zone disposition can now also track:

* the config generation in which the zone was expunged
* whether we've confirmed that the zone has been shut down

Currently `confirmed_shut_down` is always false; the planner will fill
it in to `true` in a subsequent PR.

While I was modifying this enum: removed the `Quiesced` state, which we
don't use yet (and it's not clear how that will need to be represented
when we get to it in the future).
Copy link
Copy Markdown
Contributor

@andrewjstone andrewjstone left a comment

Choose a reason for hiding this comment

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

Looks great. After all our discussion today, this lines up with expectations. It also provides us with the ability now to fix bugs like #7380.

I like the name change of the bool from confirmed_shut_down to ready_for_cleanup. Please be sure to change the commit message to reflect this on merge.

@jgallagher
Copy link
Copy Markdown
Contributor Author

Couple small but nontrivial edits since the review:

  • 8a52446 adds a test of the UPDATE ... SQL in the schema migration (no changes necessary; I was pretty sure the updates were fine but good to confirm)
  • bf1319b adds unicode symbols to indicate the ready_for_cleanup status in blueprint displays and diffs

@jgallagher jgallagher merged commit 96bb294 into main Feb 20, 2025
@jgallagher jgallagher deleted the john/blueprint-disposition-expunged-cleanup branch February 20, 2025 19:15
jgallagher added a commit that referenced this pull request Feb 20, 2025
This fell out of discussion around and is staged on top of #7558. Since
that PR removes the diesel `blueprint_zones_filter()` extension (now
that `BlueprintZoneDisposition::Expunged` carries extra data with it
that has to be spread across multiple columns), the biggest motivator
for `BlueprintZoneFilter` is gone.

We still want to force ourselves to consider zone dispositions, so this
PR keeps the `filter` argument to `Blueprint::all_omicron_zones()` and
related functions, but that filter is now a closure instead of a
`BlueprintZoneFilter`. All the call sites boiled down to one of:

* `all_omicron_zones(BlueprintZoneDisposision::is_in_service)` (helper
method that wraps `matches!(self, BlueprintZoneDisposition::InService)`)
* `all_omicron_zones(BlueprintZoneDisposision::is_expunged)` (helper
method that wraps `matches!(self, BlueprintZoneDisposition::Expunged {
.. })`)
* `all_omicron_zones(BlueprintZoneDisposition::any)` (helper that always returns `true`)

With followup work to have the planner fill in
`BlueprintZoneDisposition::Expunged { ready_for_cleanup: true }`, some
of the `is_expunged` callers will change to something like
`is_ready_for_cleanup()`. But for now, this PR should introduce no
behavioral changes at all.
hawkw pushed a commit that referenced this pull request Feb 21, 2025
The `Expunged` zone disposition can now also track:

* the config generation in which the zone was expunged
* whether we've confirmed that the zone is ready for any post-expungment cleanup

Currently `ready_for_cleanup` is always false; the planner will fill
it in to `true` in a subsequent PR.

While I was modifying this enum: removed the `Quiesced` state, which we
don't use yet (and it's not clear how that will need to be represented
when we get to it in the future).
hawkw pushed a commit that referenced this pull request Feb 21, 2025
This fell out of discussion around and is staged on top of #7558. Since
that PR removes the diesel `blueprint_zones_filter()` extension (now
that `BlueprintZoneDisposition::Expunged` carries extra data with it
that has to be spread across multiple columns), the biggest motivator
for `BlueprintZoneFilter` is gone.

We still want to force ourselves to consider zone dispositions, so this
PR keeps the `filter` argument to `Blueprint::all_omicron_zones()` and
related functions, but that filter is now a closure instead of a
`BlueprintZoneFilter`. All the call sites boiled down to one of:

* `all_omicron_zones(BlueprintZoneDisposision::is_in_service)` (helper
method that wraps `matches!(self, BlueprintZoneDisposition::InService)`)
* `all_omicron_zones(BlueprintZoneDisposision::is_expunged)` (helper
method that wraps `matches!(self, BlueprintZoneDisposition::Expunged {
.. })`)
* `all_omicron_zones(BlueprintZoneDisposition::any)` (helper that always returns `true`)

With followup work to have the planner fill in
`BlueprintZoneDisposition::Expunged { ready_for_cleanup: true }`, some
of the `is_expunged` callers will change to something like
`is_ready_for_cleanup()`. But for now, this PR should introduce no
behavioral changes at all.
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