Github user srdo commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1696#discussion_r79992419
  
    --- Diff: 
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpout.java
 ---
    @@ -145,6 +154,10 @@ private void initialize(Collection<TopicPartition> 
partitions) {
                 }
     
                 retryService.retainAll(partitions);
    +            
    +            //Emitted messages for partitions that are no longer assigned 
to this spout can't be acked, and they shouldn't be retried. Remove them from 
emitted.
    +            Set<TopicPartition> partitionsSet = new HashSet(partitions);
    +            emitted.removeIf((msgId) -> 
!partitionsSet.contains(msgId.getTopicPartition()));
    --- End diff --
    
    The messages should be getting removed from retryService in line 156. It's 
my impression that onPartitionsAssigned will be getting called immediately 
after onPartitionsRevoked, before the current call to poll returns (see 
https://kafka.apache.org/090/javadoc/org/apache/kafka/clients/consumer/ConsumerRebalanceListener.html).


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to