niket-goel commented on code in PR #12508: URL: https://github.com/apache/kafka/pull/12508#discussion_r947308803
########## raft/src/main/java/org/apache/kafka/raft/LeaderState.java: ########## @@ -246,20 +264,30 @@ private List<ReplicaState> followersByDescendingFetchOffset() { .collect(Collectors.toList()); } - private boolean updateEndOffset(ReplicaState state, - LogOffsetMetadata endOffsetMetadata) { + private void verifyEndOffsetUpdate( + ReplicaState state, + LogOffsetMetadata endOffsetMetadata + ) { state.endOffset.ifPresent(currentEndOffset -> { if (currentEndOffset.offset > endOffsetMetadata.offset) { if (state.nodeId == localId) { throw new IllegalStateException("Detected non-monotonic update of local " + - "end offset: " + currentEndOffset.offset + " -> " + endOffsetMetadata.offset); + "end offset: " + currentEndOffset.offset + " -> " + endOffsetMetadata.offset); } else { log.warn("Detected non-monotonic update of fetch offset from nodeId {}: {} -> {}", - state.nodeId, currentEndOffset.offset, endOffsetMetadata.offset); + state.nodeId, currentEndOffset.offset, endOffsetMetadata.offset); } } }); - + } + private boolean updateEndOffset( + ReplicaState state, + LogOffsetMetadata endOffsetMetadata, + boolean verifyUpdate Review Comment: Wanted to retain the verification step in the method in case we want to use it elsewhere in the future. -- 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