Skip to content

Commit

Permalink
c/partition_balancer: early return in planner main func
Browse files Browse the repository at this point in the history
  • Loading branch information
ztlpn committed Oct 27, 2022
1 parent cebb295 commit 04e041e
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/v/cluster/partition_balancer_planner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -720,19 +720,22 @@ partition_balancer_planner::plan_reassignments(
}

if (
!result.violations.is_empty()
|| !_state.ntps_with_broken_rack_constraint().empty()) {
init_ntp_sizes_from_health_report(health_report, rrs);
get_unavailable_nodes_reassignments(result, rrs);
get_rack_constraint_repair_reassignments(result, rrs);
get_full_node_reassignments(result, rrs);
if (!result.reassignments.empty()) {
result.status = status::movement_planned;
}

result.violations.is_empty()
&& _state.ntps_with_broken_rack_constraint().empty()) {
result.status = status::empty;
return result;
}

init_ntp_sizes_from_health_report(health_report, rrs);

get_unavailable_nodes_reassignments(result, rrs);
get_rack_constraint_repair_reassignments(result, rrs);
get_full_node_reassignments(result, rrs);

if (!result.reassignments.empty()) {
result.status = status::movement_planned;
}

return result;
}

Expand Down

0 comments on commit 04e041e

Please sign in to comment.