You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by revans2 <gi...@git.apache.org> on 2017/02/07 16:51:59 UTC

[GitHub] storm pull request #1919: STORM-2340: fix At-Most-Once issue in KafkaSpout

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

    https://github.com/apache/storm/pull/1919#discussion_r99868716
  
    --- Diff: external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpout.java ---
    @@ -319,8 +320,10 @@ private boolean emitTupleIfNotEmitted(ConsumerRecord<K, V> record) {
                     } else {
                         collector.emit(tuple, msgId);
                     }
    -                emitted.add(msgId);
    -                numUncommittedOffsets++;
    +                if(!consumerAutoCommitMode){//only need to track in none-AutoCommitMode
    +                    emitted.add(msgId);
    --- End diff --
    
    I think we still want to track emitted even in auto commit mode.  Replaying a failed tuple will not work unless it is added to emitted and even with auto commit some people may want to replay tuples.
    
    numUncommittedOffsets is only ever decremented in auto commit mode so that part of the change is fine.  Although, it would be good to add a javadoc to numUncommittedOffsets indicating that it is not modified in auto commit mode.


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