diff --git a/storage_controller/src/service.rs b/storage_controller/src/service.rs index 1e81b5c5a2..ff9c1434f3 100644 --- a/storage_controller/src/service.rs +++ b/storage_controller/src/service.rs @@ -4312,6 +4312,13 @@ impl Service { continue; } + if !new_nodes.values().any(Node::is_available) { + // Special case for when all nodes are unavailable: there is no point + // trying to reschedule since there's nowhere else to go. Without this + // branch we incorrectly detach tenants in response to node unavailability. + continue; + } + if tenant_shard.intent.demote_attached(scheduler, node_id) { tenant_shard.sequence = tenant_shard.sequence.next();