clolov commented on code in PR #15213:
URL: https://github.com/apache/kafka/pull/15213#discussion_r1482965204


##########
core/src/main/scala/kafka/log/UnifiedLog.scala:
##########
@@ -1300,18 +1301,29 @@ class UnifiedLog(@volatile var logStartOffset: Long,
       } else if (targetTimestamp == 
ListOffsetsRequest.EARLIEST_LOCAL_TIMESTAMP) {
         val curLocalLogStartOffset = localLogStartOffset()
 
-        val earliestLocalLogEpochEntry = leaderEpochCache.asJava.flatMap(cache 
=> {
-          val epoch = cache.epochForOffset(curLocalLogStartOffset)
-          if (epoch.isPresent) cache.epochEntry(epoch.getAsInt) else 
Optional.empty[EpochEntry]()
-        })
-
-        val epochOpt = if (earliestLocalLogEpochEntry.isPresent && 
earliestLocalLogEpochEntry.get().startOffset <= curLocalLogStartOffset)
-          Optional.of[Integer](earliestLocalLogEpochEntry.get().epoch)
-        else Optional.empty[Integer]()
+        var epochResult: Optional[Integer] = Optional.empty()

Review Comment:
   I believe the condition for both this and the below need to be slightly 
altered to accommodate for 
https://github.com/apache/kafka/pull/15213#discussion_r1481540437. I have since 
made the change so let me know whether it is okay with you 😊 



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