Skip to content

Conversation

@davepacheco
Copy link
Collaborator

Fixes #2318.

@davepacheco davepacheco self-assigned this Oct 22, 2025
) -> Result<Generation, Error> {
for (_sled_id, zone_config, nexus_config) in
self.all_nexus_zones(BlueprintZoneDisposition::is_in_service)
self.all_nexus_zones(BlueprintZoneDisposition::could_be_running)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why make this shift? From what I can tell, could_be_running is the same as is_in_service, but also includes zones which are "expunged, but not ready for cleanup".

If a Nexus zone is expunged, do we want to be including it here? (If we needed this above, wouldn't it only be used when re-assigning sagas from one expunged Nexus to another expunged Nexus?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Basically just because it's possible for an expunged, not-yet-cleaned-up Nexus to still be running and call this function and it can correctly determine its generation. You're right that in this case, it only enables it to assign sagas to itself, which isn't useful. Those will wind up re-assigned to another after this one becomes ready for cleanup.

// want some expunged zones and some non-expunged zones in each of two
// different generations.

// Frst, create a basic blueprint with several Nexus zones in generation 1.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Frst, create a basic blueprint with several Nexus zones in generation 1.
// First, create a basic blueprint with several Nexus zones in generation 1.

Comment on lines +257 to +266
// It is possible for the expunged and not-yet-ready-for-cleanup zone in
// generation 2 to wind up calling this function. It should not find
// itself!
let matched = find_expunged_same_generation(
&blueprint3,
SecId(g2_expunged_not_cleaned_up.into_untyped_uuid()),
)
.unwrap();
assert_eq!(matched.len(), 1);
assert_eq!(matched[0], g2_matched);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed that we don't want it to find itself, but why let it find the other zones either? This lets us do re-assignment from expunged zone -> expunged zone, which is pointless

Copy link
Contributor

Choose a reason for hiding this comment

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

This is finding the not expunged Nexus from g2, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

g2_matched is set on line 246 to g2_expunged_cleaned_up - I think this is returning an expunged Nexus

)
.unwrap();
assert_eq!(
matched.into_iter().collect::<BTreeSet<_>>(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Tiny nit - should find_expunged_same_generation() return a Result<impl Iterator<Item=...>, Error> instead so we don't have to do this Vec -> into_iter() -> BTreeSet dance?

Comment on lines +257 to +266
// It is possible for the expunged and not-yet-ready-for-cleanup zone in
// generation 2 to wind up calling this function. It should not find
// itself!
let matched = find_expunged_same_generation(
&blueprint3,
SecId(g2_expunged_not_cleaned_up.into_untyped_uuid()),
)
.unwrap();
assert_eq!(matched.len(), 1);
assert_eq!(matched[0], g2_matched);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is finding the not expunged Nexus from g2, right?

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.

steno upgrade

3 participants