@@ -37,10 +37,19 @@ pub(crate) async fn clean_up_expunged_zones<R: CleanupResolver>(
37
37
resolver : & R ,
38
38
blueprint : & Blueprint ,
39
39
) -> Result < ( ) , Vec < anyhow:: Error > > {
40
+ // TODO-correctness Decommissioning cockroach nodes is currently disabled
41
+ // while we work through issues with timing; see
42
+ // https://github.com/oxidecomputer/omicron/issues/8445. We keep the
43
+ // implementation around and gate it via an argument because we already have
44
+ // unit tests for it and because we'd like to restore it once
45
+ // cockroach-admin knows how to gate decommissioning correctly.
46
+ let decommission_cockroach = false ;
47
+
40
48
clean_up_expunged_zones_impl (
41
49
opctx,
42
50
datastore,
43
51
resolver,
52
+ decommission_cockroach,
44
53
blueprint
45
54
. all_omicron_zones ( BlueprintZoneDisposition :: is_ready_for_cleanup) ,
46
55
)
@@ -51,6 +60,7 @@ async fn clean_up_expunged_zones_impl<R: CleanupResolver>(
51
60
opctx : & OpContext ,
52
61
datastore : & DataStore ,
53
62
resolver : & R ,
63
+ decommission_cockroach : bool ,
54
64
zones_to_clean_up : impl Iterator < Item = ( SledUuid , & BlueprintZoneConfig ) > ,
55
65
) -> Result < ( ) , Vec < anyhow:: Error > > {
56
66
let errors: Vec < anyhow:: Error > = stream:: iter ( zones_to_clean_up)
@@ -66,12 +76,18 @@ async fn clean_up_expunged_zones_impl<R: CleanupResolver>(
66
76
BlueprintZoneType :: Nexus ( _) => None ,
67
77
68
78
// Zones which need cleanup after expungement.
69
- BlueprintZoneType :: CockroachDb ( _) => Some (
70
- decommission_cockroachdb_node (
71
- opctx, datastore, resolver, config. id , & log,
72
- )
73
- . await ,
74
- ) ,
79
+ BlueprintZoneType :: CockroachDb ( _) => {
80
+ if decommission_cockroach {
81
+ Some (
82
+ decommission_cockroachdb_node (
83
+ opctx, datastore, resolver, config. id , & log,
84
+ )
85
+ . await ,
86
+ )
87
+ } else {
88
+ None
89
+ }
90
+ }
75
91
BlueprintZoneType :: Oximeter ( _) => Some (
76
92
oximeter_cleanup ( opctx, datastore, config. id , & log) . await ,
77
93
) ,
@@ -303,6 +319,11 @@ mod test {
303
319
async fn test_clean_up_cockroach_zones (
304
320
cptestctx : & ControlPlaneTestContext ,
305
321
) {
322
+ // The whole point of this test is to check that we send decommissioning
323
+ // requests; enable that. (See the real `clean_up_expunged_zones()` for
324
+ // more context.)
325
+ let decommission_cockroach = true ;
326
+
306
327
// Test setup boilerplate.
307
328
let nexus = & cptestctx. server . server_context ( ) . nexus ;
308
329
let datastore = nexus. datastore ( ) ;
@@ -356,6 +377,7 @@ mod test {
356
377
& opctx,
357
378
datastore,
358
379
& fake_resolver,
380
+ decommission_cockroach,
359
381
iter:: once ( ( any_sled_id, & crdb_zone) ) ,
360
382
)
361
383
. await
@@ -402,6 +424,7 @@ mod test {
402
424
& opctx,
403
425
datastore,
404
426
& fake_resolver,
427
+ decommission_cockroach,
405
428
iter:: once ( ( any_sled_id, & crdb_zone) ) ,
406
429
)
407
430
. await
@@ -433,6 +456,7 @@ mod test {
433
456
& opctx,
434
457
datastore,
435
458
& fake_resolver,
459
+ decommission_cockroach,
436
460
iter:: once ( ( any_sled_id, & crdb_zone) ) ,
437
461
)
438
462
. await
@@ -461,6 +485,7 @@ mod test {
461
485
& opctx,
462
486
datastore,
463
487
& fake_resolver,
488
+ decommission_cockroach,
464
489
iter:: once ( ( any_sled_id, & crdb_zone) ) ,
465
490
)
466
491
. await
0 commit comments