@@ -101,9 +101,10 @@ impl Node {
101
101
} ;
102
102
103
103
if let Some ( kcs) = & self . key_share_computer {
104
- // We know from our `ValidatedReconfigureMsg` that we haven't seen a newer
105
- // configuration and we have the correct last committed configuration. Therefore if we are computing a key share,
106
- // we must be doing it for a stale commit and should cancel it.
104
+ // We know from our `ValidatedReconfigureMsg` that we haven't seen
105
+ // a newer configuration and we have the correct last committed
106
+ // configuration. Therefore if we are computing a key share, we must
107
+ // be doing it for a stale commit and should cancel it.
107
108
//
108
109
// I don't think it's actually possible to hit this condition, but
109
110
// we check anyway.
@@ -139,6 +140,19 @@ impl Node {
139
140
{
140
141
let ps = ctx. persistent_state ( ) ;
141
142
143
+ if let Some ( expunged) = & ps. expunged {
144
+ error ! (
145
+ self . log,
146
+ "Commit attempted on expunged node" ;
147
+ "expunged_epoch" => %expunged. epoch,
148
+ "expunging_node" => %expunged. from
149
+ ) ;
150
+ return Err ( CommitError :: Expunged {
151
+ epoch : expunged. epoch ,
152
+ from : expunged. from . clone ( ) ,
153
+ } ) ;
154
+ }
155
+
142
156
// If we have a configuration the rack id must match the one from
143
157
// Nexus
144
158
if let Some ( ps_rack_id) = ps. rack_id ( ) {
@@ -385,6 +399,10 @@ impl Node {
385
399
ps. expunged = Some ( ExpungedMetadata { epoch, from } ) ;
386
400
true
387
401
} ) ;
402
+
403
+ // Stop coordinating and computing a key share
404
+ self . coordinator_state = None ;
405
+ self . key_share_computer = None ;
388
406
} else {
389
407
let m = concat ! (
390
408
"Received Expunge message, but we have no configurations. " ,
@@ -820,6 +838,8 @@ pub enum CommitError {
820
838
) ,
821
839
#[ error( "cannot commit: not prepared for epoch {0}" ) ]
822
840
NotPrepared ( Epoch ) ,
841
+ #[ error( "cannot commit: expunged at epoch {epoch} by {from}" ) ]
842
+ Expunged { epoch : Epoch , from : PlatformId } ,
823
843
}
824
844
825
845
#[ cfg( test) ]
0 commit comments