jsancio commented on a change in pull request #9816: URL: https://github.com/apache/kafka/pull/9816#discussion_r557556584
########## File path: core/src/main/scala/kafka/raft/KafkaMetadataLog.scala ########## @@ -147,18 +199,106 @@ class KafkaMetadataLog( } override def createSnapshot(snapshotId: raft.OffsetAndEpoch): RawSnapshotWriter = { - FileRawSnapshotWriter.create(log.dir.toPath, snapshotId) + // TODO: Talk to Jason about truncation past the high-watermark since it can lead to truncation past snapshots. Review comment: If you look at the if statement below this comment... ```scala if (latest.epoch > snapshotId.epoch || latest.offset > snapshotId.offset) { ``` That naked offset comparison is only valid if the snapshot are always less that the high-watermark and we never truncate past the high-watermark. I checked this after writing the comment. Out side of data loss we don't allow followers to truncate past the high watermark. ---------------------------------------------------------------- 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: us...@infra.apache.org