dajac commented on a change in pull request #11170: URL: https://github.com/apache/kafka/pull/11170#discussion_r692164057
########## File path: core/src/main/scala/kafka/server/ReplicaManager.scala ########## @@ -1420,6 +1423,10 @@ class ReplicaManager(val config: KafkaConfig, } val partitionsToBeFollower = partitionStates.filter { case (k, _) => !partitionsToBeLeader.contains(k) } + val partitionsToUpdateIdForFollower = topicIdUpdatePartitions.filter { case (_, partitionState) => + partitionState.leader != localBrokerId + } Review comment: Could we avoid having to re-iterate over `topicIdUpdatePartitions` by applying the condition before adding the partition to `topicIdUpdatePartitions`? I have opened a PR to do the same for the two collections above: https://github.com/apache/kafka/pull/11225 -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org