diff options
author | Alex Auvolat <alex@adnab.me> | 2023-12-08 10:36:37 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-12-08 10:36:37 +0100 |
commit | 91b874c4efa40e64663368369a712e0a5a389e53 (patch) | |
tree | ba44ad6434b2c7a162eb6b7841a35e18ea94e647 | |
parent | 431b28e0cfdc9cac6c649193cf602108a8b02997 (diff) | |
download | garage-91b874c4efa40e64663368369a712e0a5a389e53.tar.gz garage-91b874c4efa40e64663368369a712e0a5a389e53.zip |
rpc: fix system::health
-rw-r--r-- | src/rpc/system.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/system.rs b/src/rpc/system.rs index adfef6b6..a8f12852 100644 --- a/src/rpc/system.rs +++ b/src/rpc/system.rs @@ -456,14 +456,14 @@ impl System { let mut partitions_quorum = 0; let mut partitions_all_ok = 0; for (_, hash) in partitions.iter() { - let write_sets = layout + let mut write_sets = layout .versions .iter() .map(|x| x.nodes_of(hash, x.replication_factor)); let has_quorum = write_sets .clone() .all(|set| set.filter(|x| node_up(x)).count() >= quorum); - let all_ok = write_sets.clone().all(|mut set| set.all(|x| node_up(&x))); + let all_ok = write_sets.all(|mut set| set.all(|x| node_up(&x))); if has_quorum { partitions_quorum += 1; } @@ -474,7 +474,7 @@ impl System { // Determine overall cluster status let status = - if partitions_quorum == partitions.len() && storage_nodes_ok == storage_nodes.len() { + if partitions_all_ok == partitions.len() && storage_nodes_ok == storage_nodes.len() { ClusterHealthStatus::Healthy } else if partitions_quorum == partitions.len() { ClusterHealthStatus::Degraded |