CalvinConfluent commented on code in PR #13489:
URL: https://github.com/apache/kafka/pull/13489#discussion_r1159263750


##########
core/src/main/scala/kafka/cluster/Partition.scala:
##########
@@ -992,6 +1003,11 @@ class Partition(val topicPartition: TopicPartition,
     }
   }
 
+  private def isBrokerEpochIsrEligible(storedBrokerEpoch: Option[Long], 
cachedBrokerEpoch: Option[Long]): Boolean = {
+    storedBrokerEpoch.isDefined && cachedBrokerEpoch.isDefined &&
+      (storedBrokerEpoch.get == -1 || (storedBrokerEpoch == cachedBrokerEpoch))

Review Comment:
   In the case of _storedBrokerEpoch_ and _ cachedBrokerEpoch_ are both null, 
it should return false. Without the second bracket, it will return true.



##########
core/src/main/scala/kafka/cluster/Partition.scala:
##########
@@ -992,6 +1003,11 @@ class Partition(val topicPartition: TopicPartition,
     }
   }
 
+  private def isBrokerEpochIsrEligible(storedBrokerEpoch: Option[Long], 
cachedBrokerEpoch: Option[Long]): Boolean = {
+    storedBrokerEpoch.isDefined && cachedBrokerEpoch.isDefined &&
+      (storedBrokerEpoch.get == -1 || (storedBrokerEpoch == cachedBrokerEpoch))

Review Comment:
   In the case of _storedBrokerEpoch_ and _cachedBrokerEpoch_ are both null, it 
should return false. Without the second bracket, it will return true.



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