@@ -2708,33 +2708,36 @@ impl Downstairs {
2708
2708
/// The live-repair may continue after this point to clean up reserved jobs,
2709
2709
/// to avoid blocking dependencies, but jobs are replaced with no-ops.
2710
2710
fn abort_repair ( & mut self , up_state : & UpstairsState ) {
2711
- assert ! ( self . clients. iter( ) . any( |c| matches!(
2712
- c. state( ) ,
2713
- DsState :: LiveRepair |
2714
- // If connection aborted, and restarted, then the re-negotiation
2715
- // could have won this race, and transitioned the reconnecting
2716
- // downstairs from LiveRepair to Faulted to LiveRepairReady.
2717
- DsState :: LiveRepairReady |
2718
- // If just a single IO reported failure, we will fault this
2719
- // downstairs and it won't yet have had a chance to move back
2720
- // around to LiveRepairReady yet.
2721
- DsState :: Faulted |
2722
- // It's also possible for a Downstairs to be in the process of
2723
- // stopping, due a fault or disconnection
2724
- DsState :: Stopping ( ..) // XXX should we be more specific here?
2725
- ) ) ) ;
2711
+ let mut found_valid_state = false ;
2726
2712
for i in ClientId :: iter ( ) {
2727
2713
match self . clients [ i] . state ( ) {
2728
2714
DsState :: LiveRepair => {
2715
+ found_valid_state = true ;
2729
2716
self . fault_client (
2730
2717
i,
2731
2718
up_state,
2732
2719
ClientFaultReason :: FailedLiveRepair ,
2733
2720
) ;
2734
2721
}
2735
- DsState :: LiveRepairReady => {
2736
- // TODO I don't think this is necessary
2737
- self . skip_all_jobs ( i) ;
2722
+ // If connection aborted, and restarted, then the re-negotiation
2723
+ // could have won this race, and transitioned the reconnecting
2724
+ // downstairs from LiveRepair to Faulted to LiveRepairReady.
2725
+ DsState :: LiveRepairReady => found_valid_state = true ,
2726
+
2727
+ // If just a single IO reported failure, we will fault this
2728
+ // downstairs and it won't yet have had a chance to move back
2729
+ // around to LiveRepairReady yet.
2730
+ DsState :: Faulted => found_valid_state = true ,
2731
+
2732
+ // It's also possible for a Downstairs to be in the process of
2733
+ // stopping, due a fault or disconnection
2734
+ DsState :: Stopping (
2735
+ ClientStopReason :: Replacing
2736
+ | ClientStopReason :: Disabled
2737
+ | ClientStopReason :: Deactivated
2738
+ | ClientStopReason :: Fault ( ..) ,
2739
+ ) => {
2740
+ found_valid_state = true ;
2738
2741
}
2739
2742
_ => { }
2740
2743
}
@@ -2744,6 +2747,11 @@ impl Downstairs {
2744
2747
// always clear it.
2745
2748
self . clients [ i] . clear_repair_state ( ) ;
2746
2749
}
2750
+ assert ! (
2751
+ found_valid_state,
2752
+ "abort_repair called without a valid client state: {:?}" ,
2753
+ self . clients. iter( ) . map( |c| c. state( ) ) . collect:: <Vec <_>>( ) ,
2754
+ ) ;
2747
2755
2748
2756
if let Some ( repair) = & mut self . repair {
2749
2757
repair. aborting_repair = true ;
0 commit comments