Skip to content

Commit

Permalink
fix completed updates spawning spurious update sagas
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Aug 5, 2024
1 parent 3b0a270 commit 7f6765d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions nexus/src/app/sagas/instance_update/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ impl UpdatesRequired {
new_runtime.propolis_id =
Some(migration.target_propolis_id);
network_config = Some(NetworkConfigUpdate::to_vmm(new_vmm));
update_required = true;
}

// Welp, the migration has succeeded, but the target Propolis
Expand All @@ -593,6 +594,7 @@ impl UpdatesRequired {
"target_propolis_id" => %migration.target_propolis_id,
);
new_runtime.propolis_id = None;
update_required = true;
}

// If the target reports that the migration has completed,
Expand All @@ -612,9 +614,8 @@ impl UpdatesRequired {
);
new_runtime.migration_id = None;
new_runtime.dst_propolis_id = None;
update_required = true;
}

update_required = true;
}
}

Expand All @@ -625,7 +626,11 @@ impl UpdatesRequired {
// instance is no longer incarnated on a sled, and we must update the
// state of the world to reflect that.
let deprovision = if new_runtime.propolis_id.is_none() {
update_required = true;
// N.B. that this does *not* set `update_required`, because
// `new_runtime.propolis_id` might be `None` just because there was,
// already, no VMM there. `update_required` gets set above if there
// was any actual state change.

// We no longer have a VMM.
new_runtime.nexus_state = InstanceState::NoVmm;
// If the active VMM was destroyed and the instance has not migrated
Expand Down

0 comments on commit 7f6765d

Please sign in to comment.