jsancio commented on a change in pull request #10085: URL: https://github.com/apache/kafka/pull/10085#discussion_r623367352
########## File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java ########## @@ -311,8 +311,18 @@ private void updateListenersProgress(long highWatermark) { private void updateListenersProgress(List<ListenerContext> listenerContexts, long highWatermark) { for (ListenerContext listenerContext : listenerContexts) { listenerContext.nextExpectedOffset().ifPresent(nextExpectedOffset -> { - if (nextExpectedOffset < log.startOffset()) { - listenerContext.fireHandleSnapshot(log.startOffset()); + if (nextExpectedOffset < log.startOffset() && nextExpectedOffset < highWatermark) { + SnapshotReader<T> snapshot = latestSnapshot().orElseThrow(() -> { + return new IllegalStateException( + String.format( + "Snapshot expected when next offset is %s, log start offset is %s and high-watermark is %s", Review comment: Good idea. I decided to use `getClass().getTypeName()`. -- 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