Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/apply/assigners/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/segmentio/topicctl/pkg/admin"
"github.com/segmentio/topicctl/pkg/config"
log "github.com/sirupsen/logrus"
)

// EvaluateAssignments determines whether the given assignments are consistent
Expand Down Expand Up @@ -61,6 +62,10 @@ func EvaluateAssignments(
brokerRacks := admin.BrokerRacks(brokers)
for _, assignment := range assignments {
if len(assignment.Replicas) != len(assignment.DistinctRacks(brokerRacks)) {
log.Errorf(
"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
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/apply/rebalancers/frequency.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (f *FrequencyRebalancer) Rebalance(
if err != nil {
return nil, err
} else if !ok {
return nil, fmt.Errorf("Starting assignments do not satisfy placement config")
return nil, fmt.Errorf("starting assignments on topic %s do not satisfy placement config - assignments: %#v", topic, curr)
}

desired := admin.CopyAssignments(curr)
Expand Down