You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ju...@apache.org on 2020/04/28 16:13:20 UTC
[kafka] branch trunk updated: Minor: remove redundant check in auto
preferred leader election (#8566)
This is an automated email from the ASF dual-hosted git repository.
junrao pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 77ac06f Minor: remove redundant check in auto preferred leader election (#8566)
77ac06f is described below
commit 77ac06f3f1921d118b9854ee7b8a4d3b58e832a4
Author: Leonard Ge <62...@users.noreply.github.com>
AuthorDate: Tue Apr 28 17:12:00 2020 +0100
Minor: remove redundant check in auto preferred leader election (#8566)
This is a minor follower up PR of #8524
Reviewer: Jun Rao <ju...@gmail.com>
---
core/src/main/scala/kafka/controller/KafkaController.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/src/main/scala/kafka/controller/KafkaController.scala b/core/src/main/scala/kafka/controller/KafkaController.scala
index 82be66a..c6916a2 100644
--- a/core/src/main/scala/kafka/controller/KafkaController.scala
+++ b/core/src/main/scala/kafka/controller/KafkaController.scala
@@ -1065,7 +1065,7 @@ class KafkaController(val config: KafkaConfig,
if (imbalanceRatio > (config.leaderImbalancePerBrokerPercentage.toDouble / 100)) {
// do this check only if the broker is live and there are no partitions being reassigned currently
// and preferred replica election is not in progress
- val candidatePartitions = topicsNotInPreferredReplica.keys.filter(tp => controllerContext.isReplicaOnline(leaderBroker, tp) &&
+ val candidatePartitions = topicsNotInPreferredReplica.keys.filter(tp =>
controllerContext.partitionsBeingReassigned.isEmpty &&
!topicDeletionManager.isTopicQueuedUpForDeletion(tp.topic) &&
controllerContext.allTopics.contains(tp.topic) &&