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



##########
File path: core/src/main/scala/kafka/server/ReplicaManager.scala
##########
@@ -1392,11 +1393,24 @@ class ReplicaManager(val config: KafkaConfig,
                   s"leader epoch $currentLeaderEpoch")
                 responseMap.put(topicPartition, Errors.STALE_CONTROLLER_EPOCH)
               } else {
-                stateChangeLogger.info(s"Ignoring LeaderAndIsr request from " +
-                  s"controller $controllerId with correlation id 
$correlationId " +
-                  s"epoch $controllerEpoch for partition $topicPartition since 
its associated " +
-                  s"leader epoch $requestLeaderEpoch matches the current 
leader epoch")
-                responseMap.put(topicPartition, Errors.STALE_CONTROLLER_EPOCH)
+                // The controller may send LeaderAndIsr to upgrade to using 
topic IDs without bumping the epoch.
+                val error = requestTopicId match {
+                  case Some(topicId) if logTopicId.isEmpty =>
+                    // If we have a matching epoch, we expect the log to be 
defined.
+                    val log = localLogOrException(partition.topicPartition)
+                    log.assignTopicId(topicId)
+                    stateChangeLogger.info(s"Updating log for $topicPartition 
to assign topic ID " +
+                      s"$topicId from LeaderAndIsr request from controller 
$controllerId with correlation" +
+                      s" id $correlationId epoch $controllerEpoch")

Review comment:
       ah i meant to do that. I missed it here.




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