feyman2016 commented on a change in pull request #10593: URL: https://github.com/apache/kafka/pull/10593#discussion_r654340330
########## File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java ########## @@ -2255,9 +2255,9 @@ public void resign(int epoch) { @Override public Optional<SnapshotWriter<T>> createSnapshot(long committedOffset, int committedEpoch) { - return log.createNewSnapshot( - new OffsetAndEpoch(committedOffset + 1, committedEpoch) - ).map(snapshot -> { + final OffsetAndEpoch snapshotId = new OffsetAndEpoch(committedOffset + 1, committedEpoch); + validateSnapshotId(snapshotId); Review comment: @jsancio Totally understood, I just confirmed the validation logic has been covered already as you mentioned, so just kept the test. ########## File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java ########## @@ -2255,9 +2255,9 @@ public void resign(int epoch) { @Override public Optional<SnapshotWriter<T>> createSnapshot(long committedOffset, int committedEpoch) { - return log.createNewSnapshot( - new OffsetAndEpoch(committedOffset + 1, committedEpoch) - ).map(snapshot -> { + final OffsetAndEpoch snapshotId = new OffsetAndEpoch(committedOffset + 1, committedEpoch); + validateSnapshotId(snapshotId); Review comment: @jsancio Totally understood, I just confirmed the validation logic has been covered already as you mentioned, so just kept the test and updated the PR name -- 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