From 46e7a589ec7810c05095d65dff049f91d24c29ac Mon Sep 17 00:00:00 2001 From: Alexey Zatelepin Date: Tue, 14 May 2024 23:33:51 +0200 Subject: [PATCH] c/partition_balancer: don't finish rebalance if some ntps are immutable Previously, we finished counts rebalance if no new moves could be found, even when some partitions were not moveable. This could lead to finishing too early and not achieving balanced distribution when many partitions were not moveable (e.g. because they are disabled due to recovery mode). --- src/v/cluster/partition_balancer_planner.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/v/cluster/partition_balancer_planner.cc b/src/v/cluster/partition_balancer_planner.cc index 4b4de5415663..a303f4286b43 100644 --- a/src/v/cluster/partition_balancer_planner.cc +++ b/src/v/cluster/partition_balancer_planner.cc @@ -1953,6 +1953,10 @@ ss::future<> partition_balancer_planner::get_counts_rebalancing_actions( } } }, + [&](immutable_partition& p) { + p.report_failure(change_reason::partition_count_rebalancing); + should_stop = false; + }, [](auto&) {}); return ss::stop_iteration::no;