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

    https://github.com/apache/storm/pull/1851#discussion_r97459031
  
    --- 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 --
    
    @HeartSaVioR  Given that this code is inside 
TopicOffsetOutOfRangeException, which can only happen if the spout requested 
for an offset that's not in Kafka Topic. So in which case do you see that we 
might disregard the valid offsets.


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