feyman2016 commented on a change in pull request #10593: URL: https://github.com/apache/kafka/pull/10593#discussion_r643850904
########## File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java ########## @@ -2276,6 +2277,24 @@ public void resign(int epoch) { ); } + private void validateSnapshotId(OffsetAndEpoch snapshotId) { + Optional<LogOffsetMetadata> highWatermarkOpt = quorum().highWatermark(); + if (!highWatermarkOpt.isPresent() || highWatermarkOpt.get().offset < snapshotId.offset) { + throw new IllegalArgumentException("Trying to creating snapshot with invalid snapshotId: " + snapshotId + " whose offset is larger than the high-watermark: " + Review comment: Fixed~ -- 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