This commit is contained in:
chrislu
2024-03-27 23:42:19 -07:00
parent 7463058299
commit ab9fc0ad70
9 changed files with 41 additions and 63 deletions

View File

@@ -14,8 +14,7 @@ func (balancer *Balancer) RepairTopics() []BalanceAction {
}
type TopicPartitionInfo struct {
Leader string
Followers []string
Broker string
}
// RepairMissingTopicPartitions check the stats of all brokers,
@@ -38,11 +37,7 @@ func RepairMissingTopicPartitions(brokers cmap.ConcurrentMap[string, *BrokerStat
tpi = &TopicPartitionInfo{}
topicPartitionToInfo[topicPartitionStat.Partition] = tpi
}
if topicPartitionStat.IsLeader {
tpi.Leader = broker
} else {
tpi.Followers = append(tpi.Followers, broker)
}
tpi.Broker = broker
}
}