jolshan commented on a change in pull request #11126:
URL: https://github.com/apache/kafka/pull/11126#discussion_r678601444
##########
File path: core/src/main/scala/kafka/server/ReplicaManager.scala
##########
@@ -1405,11 +1393,28 @@ 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 partition.log.isEmpty =>
+ // We wanted to assign the topic ID to the log, but the
log was unavailable.
+ stateChangeLogger.info(s"Tried to update log for
$topicPartition to assign topic ID " +
+ s"$topicId from LeaderAndIsr request from controller
$controllerId with correlation" +
+ s" id $correlationId epoch $controllerEpoch")
+ Errors.KAFKA_STORAGE_ERROR
Review comment:
Ah hmmm maybe I actually misread this code previously. I'll take a look
again.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]