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

    https://github.com/apache/storm/pull/1696#discussion_r79973663
  
    --- 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 --
    
    This looks good. I think this same logic may be needed in 
onPartitionsRevoked as well. Also, I believe the message may need to be removed 
from the retryService as well. Please correct me if I am wrong! 


---
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