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

    https://github.com/apache/storm/pull/1851#discussion_r97461150
  
    --- Diff: 
external/storm-kafka/src/jvm/org/apache/storm/kafka/PartitionManager.java ---
    @@ -199,7 +199,12 @@ private void fill() {
             try {
                 msgs = KafkaUtils.fetchMessages(_spoutConfig, _consumer, 
_partition, offset);
             } catch (TopicOffsetOutOfRangeException e) {
    -            offset = KafkaUtils.getOffset(_consumer, _partition.topic, 
_partition.partition, kafka.api.OffsetRequest.EarliestTime());
    +            long partitionLatestOffset = KafkaUtils.getOffset(_consumer, 
_partition.topic, _partition.partition, kafka.api.OffsetRequest.LatestTime());
    +            if (partitionLatestOffset < offset) {
    +                offset = partitionLatestOffset;
    +            } else {
    +                offset = KafkaUtils.getOffset(_consumer, _partition.topic, 
_partition.partition, kafka.api.OffsetRequest.EarliestTime());
    +            }
                 // fetch failed, so don't update the fetch metrics
                 
                 //fix bug [STORM-643] : remove outdated failed offsets
    --- End diff --
    
    @harshach 
    Either is fine for me, but if we would want to keep this, comments below 
the if statement needs to be reflected since comment is based on precondition 
that offset is equal to earliest time.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to