hachikuji commented on a change in pull request #9302:
URL: https://github.com/apache/kafka/pull/9302#discussion_r491094781



##########
File path: core/src/main/scala/kafka/controller/KafkaController.scala
##########
@@ -1067,10 +1067,7 @@ class KafkaController(val config: KafkaConfig,
       // check ratio and if greater than desired ratio, trigger a rebalance 
for the topic partitions
       // that need to be on this broker
       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.partitionsBeingReassigned.isEmpty &&

Review comment:
       It's a good question. During a reassignment, the adding replicas are 
always listed first which means the preferred leader is among the target 
replicas. My take is that we want to move the leadership onto the new preferred 
leader as soon as possible since the whole point of the reassignment is to take 
load off the removing replicas.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to