update condition

This commit is contained in:
Alex Auvolat 2021-03-05 17:08:03 +01:00
parent 5e33c3cfc9
commit 7cda917b6b

View file

@ -122,9 +122,8 @@ impl Ring {
.iter() .iter()
.map(|(_id, info)| info.datacenter.as_str()) .map(|(_id, info)| info.datacenter.as_str())
.collect::<HashSet<&str>>(); .collect::<HashSet<&str>>();
if !partitions[qv] if (p_dcs.len() < n_datacenters
.iter() && !p_dcs.contains(&node_info.datacenter.as_str()))
.any(|(_id, i)| *i.datacenter == node_info.datacenter)
|| (p_dcs.len() == n_datacenters || (p_dcs.len() == n_datacenters
&& !partitions[qv].iter().any(|(id, _i)| id == node_id)) && !partitions[qv].iter().any(|(id, _i)| id == node_id))
{ {