From 49150dfbfe887030cf6fd8395032cce88e1358a2 Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Thu, 31 Oct 2024 12:13:47 -0400 Subject: [PATCH 1/2] Remove Disconnected transient state --- cmon/src/main.rs | 1 - openapi/crucible-control.json | 1 - upstairs/src/client.rs | 5 +---- upstairs/src/lib.rs | 27 +++++++++------------------ 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/cmon/src/main.rs b/cmon/src/main.rs index d14ba6f44..183457b8c 100644 --- a/cmon/src/main.rs +++ b/cmon/src/main.rs @@ -92,7 +92,6 @@ fn short_state(dss: DsState) -> String { DsState::New => "NEW".to_string(), DsState::WaitActive => "WAC".to_string(), DsState::WaitQuorum => "WAQ".to_string(), - DsState::Disconnected => "DIS".to_string(), DsState::Reconcile => "REC".to_string(), DsState::Active => "ACT".to_string(), DsState::Faulted => "FLT".to_string(), diff --git a/openapi/crucible-control.json b/openapi/crucible-control.json index 694a749d5..3515dacb6 100644 --- a/openapi/crucible-control.json +++ b/openapi/crucible-control.json @@ -93,7 +93,6 @@ "new", "wait_active", "wait_quorum", - "disconnected", "reconcile", "active", "faulted", diff --git a/upstairs/src/client.rs b/upstairs/src/client.rs index 01312f505..115191b05 100644 --- a/upstairs/src/client.rs +++ b/upstairs/src/client.rs @@ -578,7 +578,6 @@ impl DownstairsClient { DsState::Deactivated | DsState::Reconcile - | DsState::Disconnected | DsState::WaitQuorum | DsState::WaitActive | DsState::Disabled => Some(DsState::New), @@ -859,7 +858,7 @@ impl DownstairsClient { * downstairs to receive IO, so we go to the back of the * line and have to re-verify it again. */ - DsState::Disconnected + DsState::New } }; @@ -960,7 +959,6 @@ impl DownstairsClient { DsState::New | DsState::WaitActive | DsState::WaitQuorum - | DsState::Disconnected | DsState::Reconcile | DsState::Deactivated | DsState::Disabled @@ -1045,7 +1043,6 @@ impl DownstairsClient { } } else if old_state != DsState::New && old_state != DsState::Faulted - && old_state != DsState::Disconnected && old_state != DsState::Replaced { panic!( diff --git a/upstairs/src/lib.rs b/upstairs/src/lib.rs index 802f77fd3..5afdc7601 100644 --- a/upstairs/src/lib.rs +++ b/upstairs/src/lib.rs @@ -715,17 +715,17 @@ pub(crate) struct RawReadResponse { * ┌─────────────► New ╞═════◄════════════════╗ ║ * │ ┌─────► ├─────◄──────┐ ║ ║ * │ │ └────┬───┬──┘ │ ║ ║ - * │ │ ▼ └───►───┐ │ ║ ║ - * │ bad│ ┌────┴──────┐ │ │ ║ ║ - * │ region│ │ Wait │ │ │ ║ ║ + * │ │ ▼ └───►───┐ other │ ║ ║ + * │ bad│ ┌────┴──────┐ │ failures ║ ║ + * │ region│ │ Wait │ │ ▲ ║ ║ * │ │ │ Active ├─►┐ │ │ ║ ║ - * │ │ └────┬──────┘ │ │ ┌────┴───────┐ ║ ║ - * │ │ ┌────┴──────┐ │ └──┤ │ ║ ║ - * │ │ │ Wait │ └────┤Disconnected│ ║ ║ - * │ └─────┤ Quorum ├──►────┤ │ ║ ║ - * │ └────┬──────┘ └────┬───────┘ ║ ║ + * │ │ └────┬──────┘ │ │ │ ║ ║ + * │ │ ┌────┴──────┐ │ └───────┤ ║ ║ + * │ │ │ Wait │ └─────────┤ ║ ║ + * │ └─────┤ Quorum ├──►─────────┤ ║ ║ + * │ └────┬──────┘ │ ║ ║ * │ ........▼.......... │ ║ ║ - * │failed : ┌────┴──────┐ : ▲ ║ ║ + * │failed : ┌────┴──────┐ : │ ║ ║ * │reconcile : │ Reconcile │ : │ ╔═╝ ║ * └─────────────┤ ├──►─────────┘ ║ ║ * : └────┬──────┘ : ║ ║ @@ -786,12 +786,6 @@ pub enum DsState { * Waiting for the minimum number of downstairs to be present. */ WaitQuorum, - /* - * We were connected, but did not transition all the way to - * active before the connection went away. Arriving here means the - * downstairs has to go back through the whole negotiation process. - */ - Disconnected, /* * Initial startup, downstairs are repairing from each other. */ @@ -858,9 +852,6 @@ impl std::fmt::Display for DsState { DsState::WaitQuorum => { write!(f, "WaitQuorum") } - DsState::Disconnected => { - write!(f, "Disconnected") - } DsState::Reconcile => { write!(f, "Reconcile") } From f610a22ac886bc162fe93bedf6c526336bd0e0dd Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Fri, 1 Nov 2024 11:57:44 -0400 Subject: [PATCH 2/2] Remove DsState::Migrating --- cmon/src/main.rs | 1 - openapi/crucible-control.json | 1 - upstairs/src/client.rs | 12 +----------- upstairs/src/lib.rs | 7 ------- 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/cmon/src/main.rs b/cmon/src/main.rs index 183457b8c..4f3fe1952 100644 --- a/cmon/src/main.rs +++ b/cmon/src/main.rs @@ -97,7 +97,6 @@ fn short_state(dss: DsState) -> String { DsState::Faulted => "FLT".to_string(), DsState::LiveRepairReady => "LRR".to_string(), DsState::LiveRepair => "LR".to_string(), - DsState::Migrating => "MIG".to_string(), DsState::Offline => "OFF".to_string(), DsState::Deactivated => "DAV".to_string(), DsState::Disabled => "DIS".to_string(), diff --git a/openapi/crucible-control.json b/openapi/crucible-control.json index 3515dacb6..5e193f1c7 100644 --- a/openapi/crucible-control.json +++ b/openapi/crucible-control.json @@ -98,7 +98,6 @@ "faulted", "live_repair_ready", "live_repair", - "migrating", "offline", "deactivated", "disabled", diff --git a/upstairs/src/client.rs b/upstairs/src/client.rs index 115191b05..eb60efb7c 100644 --- a/upstairs/src/client.rs +++ b/upstairs/src/client.rs @@ -590,8 +590,6 @@ impl DownstairsClient { | DsState::Faulted | DsState::New | DsState::Replaced => None, - - DsState::Migrating => panic!(), }; // Jobs are skipped and replayed in `Downstairs::reinitialize`, which is @@ -845,7 +843,6 @@ impl DownstairsClient { let new_state = match self.state { DsState::Active => DsState::Offline, DsState::Offline => DsState::Offline, - DsState::Migrating => DsState::Faulted, DsState::Faulted => DsState::Faulted, DsState::Deactivated => DsState::New, DsState::Reconcile => DsState::New, @@ -961,8 +958,7 @@ impl DownstairsClient { | DsState::WaitQuorum | DsState::Reconcile | DsState::Deactivated - | DsState::Disabled - | DsState::Migrating => panic!( + | DsState::Disabled => panic!( "enqueue should not be called from state {:?}", self.state ), @@ -1154,12 +1150,6 @@ impl DownstairsClient { // A move to Disabled can happen at any time we are talking // to a downstairs. } - _ => { - panic!( - "[{}] Missing check for transition {} to {}", - self.client_id, old_state, new_state - ); - } } if old_state != new_state { diff --git a/upstairs/src/lib.rs b/upstairs/src/lib.rs index 5afdc7601..1ae6a74a0 100644 --- a/upstairs/src/lib.rs +++ b/upstairs/src/lib.rs @@ -809,10 +809,6 @@ pub enum DsState { * This downstairs is undergoing LiveRepair */ LiveRepair, - /* - * This downstairs is being migrated to a new location - */ - Migrating, /* * This downstairs was active, but is now no longer connected. * We may have work for it in memory, so a replay is possible @@ -867,9 +863,6 @@ impl std::fmt::Display for DsState { DsState::LiveRepair => { write!(f, "LiveRepair") } - DsState::Migrating => { - write!(f, "Migrating") - } DsState::Offline => { write!(f, "Offline") }