jsancio commented on a change in pull request #10946:
URL: https://github.com/apache/kafka/pull/10946#discussion_r662604574



##########
File path: raft/src/main/java/org/apache/kafka/raft/ReplicatedCounter.java
##########
@@ -106,7 +108,10 @@ public synchronized void handleCommit(BatchReader<Integer> 
reader) {
                     lastCommittedEpoch,
                     lastOffsetSnapshotted
                 );
-                Optional<SnapshotWriter<Integer>> snapshot = 
client.createSnapshot(lastCommittedOffset, lastCommittedEpoch, 0);
+                Optional<SnapshotWriter<Integer>> snapshot = 
client.createSnapshot(

Review comment:
       We are doing this within this check:
   ```
   if (lastOffsetSnapshotted + snapshotDelayInRecords  < lastCommittedOffset) {
   ```
   As long as `snapshotDelayInRecords` is greater than `0`, which is the case 
here, I think we can be sure that `lastCommittedOffset` is not `-1`.




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