Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-2340

fix AutoCommitMode issue in KafkaSpout

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0, 1.1.0
    • Component/s: storm-kafka-client
    • Labels:
      None

      Description

      What's the issue?
      When KafkaSpout is running with AutoCommitMode=true, and ack executor=0, KafkaSpout cannot emit records after some time.

      What's the cause?
      Function poll() controls whether it need to pull more data from Kafka cluster. With the condition !waitingToEmit() && numUncommittedOffsets < maxUncommittedOffsets, it's always FALSE after reaching threshold, as numUncommittedOffsets is creasing and never reset on 'At-Most-Once' mode.

      What's the solution?
      I change the condition to !waitingToEmit() && (numUncommittedOffsets < maxUncommittedOffsets || consumerAutoCommitMode), that return TRUE with AutoCommitMode regarding of UnCommittedOffset, see the comments inline.
      Also, it's not required to track emitted(msgId) and numUncommittedOffsets with AutoCommitMode .

        Attachments

          Activity

            People

            • Assignee:
              mingmxu Xu Mingmin
              Reporter:
              mingmxu Xu Mingmin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 6h 10m
                6h 10m