chia7712 commented on code in PR #19607:
URL: https://github.com/apache/kafka/pull/19607#discussion_r2161104479


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegment.java:
##########
@@ -751,10 +751,7 @@ public Optional<FileRecords.TimestampAndOffset> 
findOffsetByTimestamp(long times
     public void close() throws IOException {
         if (maxTimestampAndOffsetSoFar != TimestampOffset.UNKNOWN)
             Utils.swallow(LOGGER, Level.WARN, "maybeAppend", () -> 
timeIndex().maybeAppend(maxTimestampSoFar(), 
shallowOffsetOfMaxTimestampSoFar(), true));

Review Comment:
   I think writing the max timestamp has a similar issue. the last entry is 
assumed to be the max timestamp after restarting. Hence, it needs to rebuild 
the index if the "true" max timestamp is not stored correctly
   
   I open KAFKA-19428 to trace it



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