You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "jsancio (via GitHub)" <gi...@apache.org> on 2023/08/17 16:40:28 UTC

[GitHub] [kafka] jsancio commented on a diff in pull request #14213: KAFKA-15345; KRaft leader notifies when listener reaches epoch start

jsancio commented on code in PR #14213:
URL: https://github.com/apache/kafka/pull/14213#discussion_r1297478095


##########
raft/src/main/java/org/apache/kafka/raft/internals/RecordsBatchReader.java:
##########
@@ -117,14 +117,8 @@ private void ensureOpen() {
     }
 
     private Optional<Batch<T>> nextBatch() {
-        while (iterator.hasNext()) {
-            Batch<T> batch = iterator.next();
-
-            if (batch.records().isEmpty()) {
-                lastReturnedOffset = batch.lastOffset();
-            } else {
-                return Optional.of(batch);
-            }
+        if (iterator.hasNext()) {

Review Comment:
   I agree. I added a couple of tests for this.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org