Replica leader election is too slow in the case of too many partitions
Reviewers: Chia-Ping Tsai
@@ -2165,7 +2165,8 @@ class KafkaController(val config: KafkaConfig,
case None => zkClient.getPreferredReplicaElection
}
- val (knownPartitions, unknownPartitions) = partitions.partition(tp => controllerContext.allPartitions.contains(tp))
+ val allPartitions = controllerContext.allPartitions
+ val (knownPartitions, unknownPartitions) = partitions.partition(tp => allPartitions.contains(tp))
unknownPartitions.foreach { p =>
info(s"Skipping replica leader election ($electionType) for partition $p by $electionTrigger since it doesn't exist.")
}
