Skip to content

Commit

Permalink
[nexus] Consider SagaUnwound instances Failed (#6658)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw authored Sep 27, 2024
1 parent 75214e1 commit 888f6a1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions nexus/db-queries/src/db/datastore/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,20 @@ impl InstanceAndActiveVmm {
InstanceState::Vmm,
Some(VmmState::Stopped | VmmState::Destroyed),
) => external::InstanceState::Stopping,
// - An instance with a "saga unwound" VMM, on the other hand, can
// be treated as "stopped", since --- unlike "destroyed" --- a new
// start saga can run at any time by just clearing out the old VMM
// ID.
(InstanceState::Vmm, Some(VmmState::SagaUnwound)) => {
external::InstanceState::Stopped
}
// - An instance with a "failed" VMM should *not* be counted as
// failed until the VMM is unlinked, because a start saga must be
// able to run "failed" instance. Until then, it will continue to
// appear "stopping".
// able to run for a "failed" instance. Until then, it will
// continue to appear "stopping".
(InstanceState::Vmm, Some(VmmState::Failed)) => {
external::InstanceState::Stopping
}
// - An instance with a "saga unwound" VMM, on the other hand, can
// be treated as "failed", since --- unlike an instance with a
// "failed" active VMM --- a new start saga can run at any time by
// just clearing out the old VMM ID.
(InstanceState::Vmm, Some(VmmState::SagaUnwound)) => {
external::InstanceState::Failed
}
// - An instance with no VMM is always "stopped" (as long as it's
// not "starting" etc.)
(InstanceState::NoVmm, _vmm_state) => {
Expand Down

0 comments on commit 888f6a1

Please sign in to comment.