jolshan commented on a change in pull request #11170:
URL: https://github.com/apache/kafka/pull/11170#discussion_r714140053



##########
File path: core/src/main/scala/kafka/server/ReplicaManager.scala
##########
@@ -1739,6 +1758,37 @@ class ReplicaManager(val config: KafkaConfig,
     partitionsToMakeFollower
   }
 
+  private def updateTopicIdForFollowers(controllerId: Int,
+                                        controllerEpoch: Int,
+                                        partitionStates: Set[Partition],
+                                        correlationId: Int,
+                                        topicIds: String => Option[Uuid]): 
Unit = {
+    val traceLoggingEnabled = stateChangeLogger.isTraceEnabled
+
+    try {
+      if (isShuttingDown.get()) {
+        if (traceLoggingEnabled) {
+          partitionStates.foreach { partition =>
+            stateChangeLogger.trace(s"Skipped the update topic ID step of the 
become-follower state " +
+              s"change with correlation id $correlationId from controller 
$controllerId epoch $controllerEpoch for " +
+              s"partition ${partition.topicPartition} since it is shutting 
down")
+          }
+        }
+      } else {
+        val partitionsToUpdateFollowerWithLeader = partitionStates.map { 
partition =>
+          partition.topicPartition -> 
partition.leaderReplicaIdOpt.getOrElse(-1)

Review comment:
       I was wondering this too, but didn't know the best way. This makes sense 
to me.




-- 
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


Reply via email to