Skip to content

Commit

Permalink
fix(dre): dre heal should not consider unhealthy nodes as replacement…
Browse files Browse the repository at this point in the history
… candidates (#794)

Co-authored-by: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
  • Loading branch information
sasa-tomic and sa-github-api authored Aug 26, 2024
1 parent d21f7cd commit 9e99906
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rs/cli/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,12 @@ impl Runner {
.collect::<BTreeMap<_, _>>();
let (available_nodes, healths) = try_join(self.registry.available_nodes().map_err(anyhow::Error::from), health_client.nodes()).await?;

// Remove the unhealthy nodes from the list of available nodes
let available_nodes = available_nodes
.into_iter()
.filter(|n| healths.get(&n.id).map_or(false, |h| h == &HealthStatus::Healthy))
.collect::<Vec<_>>();

let subnets_change_response = NetworkHealRequest::new(subnets_without_proposals)
.heal_and_optimize(available_nodes, healths)
.await?;
Expand Down

0 comments on commit 9e99906

Please sign in to comment.