You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/01/19 17:17:39 UTC

[jira] [Commented] (STORM-1455) kafka spout should not reset to the beginning of partition when offsetoutofrange exception occurs

    [ https://issues.apache.org/jira/browse/STORM-1455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15106930#comment-15106930 ] 

ASF GitHub Bot commented on STORM-1455:
---------------------------------------

GitHub user abhishekagarwal87 opened a pull request:

    https://github.com/apache/storm/pull/1026

    STORM-1455: Do not reset the emittedOffset for offsetOutOfRangeExceptions

    There are two changes in this PR 
    
    - If there is a TopicOffsetOutOfRangeException, it can be due to an old failed tuple. We should not reset the state back to the beginning. 
    - Apart from the last completed offset, also emit the last emitted offset in the metric. latestEmittedOffset now points to the last emitted offset. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/abhishekagarwal87/storm kafka-spout

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/storm/pull/1026.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1026
    
----
commit c1e8ec576a391c9431ec50eb8eb60c083417b4c7
Author: Abhishek Agarwal <ab...@inmobi.com>
Date:   2016-01-19T16:13:22Z

    STORM-1455: Do not reset the emittedOffset for offsetOutOfRangeExceptions

----


> kafka spout should not reset to the beginning of partition when offsetoutofrange exception occurs
> -------------------------------------------------------------------------------------------------
>
>                 Key: STORM-1455
>                 URL: https://issues.apache.org/jira/browse/STORM-1455
>             Project: Apache Storm
>          Issue Type: Bug
>          Components: storm-kafka
>    Affects Versions: 1.0.0
>            Reporter: Abhishek Agarwal
>            Assignee: Abhishek Agarwal
>
> https://github.com/apache/storm/blob/master/external/storm-kafka/src/jvm/storm/kafka/PartitionManager.java#L190
> {noformat}
> try {
>             msgs = KafkaUtils.fetchMessages(_spoutConfig, _consumer, _partition, offset);
>         } catch (TopicOffsetOutOfRangeException e) {
>             _emittedToOffset = KafkaUtils.getOffset(_consumer, _partition.topic, _partition.partition, kafka.api.OffsetRequest.EarliestTime());
>             LOG.warn("{} Using new offset: {}", _partition.partition, _emittedToOffset);
> {noformat}
> If there was one old offset out of range, partition manager will re-send all the offsets from EarliestTime to _emittedOffset. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)