You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/03/16 00:30:29 UTC

[GitHub] [kafka] junrao commented on a change in pull request #11856: Repair how often index entries are generated

junrao commented on a change in pull request #11856:
URL: https://github.com/apache/kafka/pull/11856#discussion_r827520576



##########
File path: core/src/main/scala/kafka/log/LogSegment.scala
##########
@@ -161,13 +161,13 @@ class LogSegment private[log] (val log: FileRecords,
       if (largestTimestamp > maxTimestampSoFar) {
         maxTimestampAndOffsetSoFar = TimestampOffset(largestTimestamp, shallowOffsetOfMaxTimestamp)
       }
+      bytesSinceLastIndexEntry += records.sizeInBytes

Review comment:
       Well, it seems that the physicalPosition we add to the index corresponds to the position before the records are appended. So, updating bytesSinceLastIndexEntry after the index append seems correct.




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org