diff options
author | Alex Auvolat <alex@adnab.me> | 2021-03-05 17:08:03 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-03-05 17:08:03 +0100 |
commit | 7cda917b6b91a1533afb3b066e4a90269c61c871 (patch) | |
tree | b861db9508ae2e4e7b4f0e53ba1c5857f41bbfa6 | |
parent | 5e33c3cfc9e80ad64778ec49e346d51ba787c9ce (diff) | |
download | garage-7cda917b6b91a1533afb3b066e4a90269c61c871.tar.gz garage-7cda917b6b91a1533afb3b066e4a90269c61c871.zip |
update condition
-rw-r--r-- | src/rpc/ring.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/rpc/ring.rs b/src/rpc/ring.rs index 906ab9f8..ee0b52ef 100644 --- a/src/rpc/ring.rs +++ b/src/rpc/ring.rs @@ -122,9 +122,8 @@ impl Ring { .iter() .map(|(_id, info)| info.datacenter.as_str()) .collect::<HashSet<&str>>(); - if !partitions[qv] - .iter() - .any(|(_id, i)| *i.datacenter == node_info.datacenter) + if (p_dcs.len() < n_datacenters + && !p_dcs.contains(&node_info.datacenter.as_str())) || (p_dcs.len() == n_datacenters && !partitions[qv].iter().any(|(id, _i)| id == node_id)) { |