From 7cda917b6b91a1533afb3b066e4a90269c61c871 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 5 Mar 2021 17:08:03 +0100 Subject: [PATCH] update condition --- src/rpc/ring.rs | 5 ++--- 1 file 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::>(); - 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)) {