K2V #293

Merged
lx merged 68 commits from k2v into main 2022-05-10 11:16:58 +00:00
Showing only changes of commit fe4a8e85be - Show all commits

View file

@ -85,13 +85,14 @@ pub async fn cmd_status(rpc_cli: &Endpoint<SystemRpc, ()>, rpc_host: NodeID) ->
format_table(healthy_nodes); format_table(healthy_nodes);
let status_keys = status.iter().map(|adv| adv.id).collect::<HashSet<_>>(); let status_keys = status.iter().map(|adv| adv.id).collect::<HashSet<_>>();
let failure_case_1 = status.iter().any(|adv| !adv.is_up); let failure_case_1 = status
.iter()
.any(|adv| !adv.is_up && matches!(layout.roles.get(&adv.id), Some(NodeRoleV(Some(_)))));
let failure_case_2 = layout let failure_case_2 = layout
.roles .roles
.items() .items()
.iter() .iter()
.filter(|(_, _, v)| v.0.is_some()) .any(|(id, _, v)| !status_keys.contains(id) && v.0.is_some());
.any(|(id, _, _)| !status_keys.contains(id));
if failure_case_1 || failure_case_2 { if failure_case_1 || failure_case_2 {
println!("\n==== FAILED NODES ===="); println!("\n==== FAILED NODES ====");
let mut failed_nodes = let mut failed_nodes =