Skip to content

Commit

Permalink
Remember that a replaced downstairs is replaced (#1426)
Browse files Browse the repository at this point in the history
Leave a downstairs in state Replaced after a replacement request until
we connect to the new downstairs and either validate it is correct or
determine it is bad.

This fixes a bug where a replaced downstairs would go to failed, then
cause problems when we eventually connect to that downstairs.

Fix for: #1425
  • Loading branch information
leftwo authored Aug 27, 2024
1 parent d4d9cae commit 88c45ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions upstairs/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,7 @@ impl DownstairsClient {

DsState::Faulted
| DsState::LiveRepair
| DsState::LiveRepairReady
| DsState::Replaced => DsState::Faulted,
| DsState::LiveRepairReady => DsState::Faulted,

DsState::New
| DsState::Deactivated
Expand All @@ -546,7 +545,8 @@ impl DownstairsClient {
| DsState::WaitActive
| DsState::Disabled => DsState::Disconnected,

DsState::Replacing => DsState::Replaced,
// If we have replaced a downstairs, don't forget that.
DsState::Replacing | DsState::Replaced => DsState::Replaced,

DsState::Migrating => panic!(),
};
Expand Down

0 comments on commit 88c45ee

Please sign in to comment.