Github user arunmahadevan commented on a diff in the pull request:
https://github.com/apache/storm/pull/2147#discussion_r119444961
--- Diff:
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpout.java
---
@@ -170,10 +182,13 @@ private void initialize(Collection<TopicPartition>
partitions) {
final long fetchOffset = doSeek(tp, committedOffset);
setAcked(tp, fetchOffset);
}
- initialized = true;
+
+ task.start();
--- End diff --
https://kafka.apache.org/0102/javadoc/org/apache/kafka/clients/consumer/ConsumerRebalanceListener.html#onPartitionsRevoked(java.util.Collection)
It appears that offsets can be committed to either kafka or externally in
`onPartitionsRevoked`. So the spout can wait to receive the acks for in-flight
messages before committing the offsets to reduce duplicates.
>I think it would be a nicer solution to eliminate most rebalances by
switching to manual partition assignment
Yes, switching to manual assignment where each task gets a fixed subset of
partitions would eliminate the re-balance completely. If we can get that out
quickly well and good, but I think it may require a re-design of the current
logic, meanwhile this patch can put some band-aid on whatever already exists in
production.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---