From d7fbe365827e897d10e7ac39de91e390843ee275 Mon Sep 17 00:00:00 2001 From: Ben McKerry <110857332+bmckerry@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:24:18 -0400 Subject: [PATCH] fix: don't error on racks not being filled out --- pkg/apply/assigners/evaluate.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/apply/assigners/evaluate.go b/pkg/apply/assigners/evaluate.go index 88e3e4b1..0881ee42 100644 --- a/pkg/apply/assigners/evaluate.go +++ b/pkg/apply/assigners/evaluate.go @@ -61,12 +61,15 @@ func EvaluateAssignments( case config.PlacementStrategyCrossRack: brokerRacks := admin.BrokerRacks(brokers) for _, assignment := range assignments { + // If a topicctl rebalance gets stopped while running, we can be in a state where + // multiple replicas are on the same rack. This should be fixed on a re-run with + // cross-rack assignment. if len(assignment.Replicas) != len(assignment.DistinctRacks(brokerRacks)) { - log.Errorf( + log.Warnf( "Expected replicas to equal number of racks, but got %d replicas and %d racks for assignment %v", len(assignment.Replicas), len(assignment.DistinctRacks(brokerRacks)), assignment, ) - return false, nil + return true, nil } } return true, nil