Skip to content

Commit e3246e2

Browse files
committed
Deactivation also goes to ConnectionMode::New
1 parent 30db97e commit e3246e2

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

upstairs/src/client.rs

+9-12
Original file line numberDiff line numberDiff line change
@@ -575,28 +575,25 @@ impl DownstairsClient {
575575
// go through the live-repair path.
576576
DsState::Stopping(ClientStopReason::NegotiationFailed(..)) => {
577577
match up_state {
578-
// If we haven't activated yet, then start from New
578+
// If we haven't activated yet (or we're deactivating) then
579+
// start from New
579580
UpstairsState::GoActive(..)
580-
| UpstairsState::Initializing => ConnectionMode::New,
581+
| UpstairsState::Initializing
582+
| UpstairsState::Deactivating { .. } => ConnectionMode::New,
581583

582584
// Otherwise, use live-repair
583-
UpstairsState::Active
584-
| UpstairsState::Deactivating { .. } => {
585-
ConnectionMode::Faulted
586-
}
585+
UpstairsState::Active => ConnectionMode::Faulted,
587586
}
588587
}
589588

590589
DsState::Stopping(ClientStopReason::Replacing) => match up_state {
591590
// If we haven't activated yet, then start from New
592-
UpstairsState::GoActive(..) | UpstairsState::Initializing => {
593-
ConnectionMode::New
594-
}
591+
UpstairsState::GoActive(..)
592+
| UpstairsState::Initializing
593+
| UpstairsState::Deactivating { .. } => ConnectionMode::New,
595594
// Otherwise, use live-repair; `ConnectionMode::Replaced`
596595
// indicates that the address is allowed to change.
597-
UpstairsState::Active | UpstairsState::Deactivating { .. } => {
598-
ConnectionMode::Replaced
599-
}
596+
UpstairsState::Active => ConnectionMode::Replaced,
600597
},
601598
};
602599
let new_state = DsState::Connecting {

0 commit comments

Comments
 (0)