jsun98 commented on a change in pull request #6496: Support kafka transactional
topics (#5404)
URL: https://github.com/apache/incubator-druid/pull/6496#discussion_r243033312
##########
File path:
extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/IncrementalPublishingKafkaIndexTaskRunner.java
##########
@@ -576,15 +561,19 @@ public void onFailure(Throwable t)
nextOffsets.put(record.partition(), record.offset() + 1);
}
-
- if
(nextOffsets.get(record.partition()).equals(endOffsets.get(record.partition()))
+ if (nextOffsets.get(record.partition()) >=
endOffsets.get(record.partition())
&& assignment.remove(record.partition())) {
log.info("Finished reading topic[%s], partition[%,d].",
record.topic(), record.partition());
KafkaIndexTask.assignPartitions(consumer, topic, assignment);
stillReading = !assignment.isEmpty();
}
}
-
+ if (nextOffsets.get(currentPartition) != null
Review comment:
I think this should be placed inside the loop, otherwise it only updates the
`nextOffsets` of at most 1 partition. In the case where the polled `records`
contain records of more than 1 partition, the nextOffsets of all those
partitions should be updated.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]