dajac commented on a change in pull request #8509:
URL: https://github.com/apache/kafka/pull/8509#discussion_r413541177



##########
File path: core/src/main/scala/kafka/server/KafkaApis.scala
##########
@@ -3084,12 +3084,9 @@ class KafkaApis(val requestChannel: RequestChannel,
     // Broker epoch in LeaderAndIsr/UpdateMetadata/StopReplica request is 
unknown
     // if the controller hasn't been upgraded to use KIP-380
     if (brokerEpochInRequest == AbstractControlRequest.UNKNOWN_BROKER_EPOCH) 
false
-    else {
-      val curBrokerEpoch = controller.brokerEpoch
-      if (brokerEpochInRequest < curBrokerEpoch) true
-      else if (brokerEpochInRequest == curBrokerEpoch) false
-      else throw new IllegalStateException(s"Epoch $brokerEpochInRequest 
larger than current broker epoch $curBrokerEpoch")
-    }
+      // brokerEpochInRequest > controller.brokerEpoch is possible in rare 
scenarios where the controller gets notified
+      // about the new broker epoch and sends a control request with this 
epoch before the broker learns about it

Review comment:
       nit: Alignment of the comment looks a bit weird. I would align it with 
the if/else.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to