aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/ring.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/ring.rs')
-rw-r--r--src/rpc/ring.rs5
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))
{