diff --git a/src/rpc/ring.rs b/src/rpc/ring.rs index 906ab9f84..ee0b52efe 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)) {