Skip to content

Commit

Permalink
cluster: fix disabling leader balancer at runtime
Browse files Browse the repository at this point in the history
Previously, the ss::repeat loop would keep running
and eventually re-arm the timer when it ran out
of work, if it was running while enable_leader_balancer
was set to false.

Fixes #4544

(cherry picked from commit 40636fa)
  • Loading branch information
jcsp authored and vbotbuildovich committed May 11, 2022
1 parent a20c3de commit 19a6383
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/v/cluster/scheduling/leader_balancer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void leader_balancer::trigger_balance() {
vlog(
clusterlog.info, "Cannot start rebalance until previous fiber exits");
_timer.arm(_idle_timeout());
return;
}

if (!_enabled()) {
Expand Down Expand Up @@ -187,6 +188,10 @@ void leader_balancer::trigger_balance() {
}

ss::future<ss::stop_iteration> leader_balancer::balance() {
if (!_enabled()) {
co_return ss::stop_iteration::yes;
}

/*
* GC the muted and last leader indices
*/
Expand Down

0 comments on commit 19a6383

Please sign in to comment.