dajac commented on a change in pull request #11170: URL: https://github.com/apache/kafka/pull/11170#discussion_r692169643
########## File path: core/src/main/scala/kafka/server/ReplicaManager.scala ########## @@ -1755,6 +1765,78 @@ class ReplicaManager(val config: KafkaConfig, partitionsToMakeFollower } + private def updateTopicIdForFollowers(controllerId: Int, + controllerEpoch: Int, + partitionStates: Map[Partition, LeaderAndIsrPartitionState], + correlationId: Int, + responseMap: mutable.Map[TopicPartition, Errors], + topicIds: String => Option[Uuid]) : Set[Partition] = { + val traceLoggingEnabled = stateChangeLogger.isTraceEnabled + // Do we need this? + partitionStates.forKeyValue { (partition, partitionState) => + if (traceLoggingEnabled) + stateChangeLogger.trace(s"Handling LeaderAndIsr request correlationId $correlationId from controller $controllerId " + + s"epoch $controllerEpoch starting the become-follower transition for partition ${partition.topicPartition} with leader " + + s"${partitionState.leader}") + responseMap.put(partition.topicPartition, Errors.NONE) + } + + val partitionsToUpdateFollower: mutable.Set[Partition] = mutable.Set() + try { + partitionStates.forKeyValue { (partition, partitionState) => + val newLeaderBrokerId = partitionState.leader + if (metadataCache.hasAliveBroker(newLeaderBrokerId)) { Review comment: Intuitively, I would have thoughts that we don't need this. The broker is already a follower in this case so the leader should be alive. What's your take on this? -- 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