mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-24 08:30:37 +00:00
storcon: do not detach tenants when all nodes are unvailable
Previously, when all nodes in the cluster became unavailable at the same time, we would detach all tenant shards. This is due to a bug in `Service::node_configure`. If all nodes are unavailable, there's no chance of reschedulling anything, so we should leave the intent states untouced. This commit adds a special case which detects this situation and skips any reschedullings.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user