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

jin xing commented on KAFKA-2893:
---------------------------------

I can reproduce this;
when we call consumer.seek(partition,offset), the offset must be bigger than 
the smallest LogSegment's baseOffset(beginning of the log) and smaller than log 
size(end of the log); 
If not, we will get "Fetch offset null is out of range";
Setting offset to be negative is obvious invalid, maybe we can reject this 
request in the consumer side, without sending it to the broker;
Am I right?

> Add Negative Partition Seek Check
> ---------------------------------
>
>                 Key: KAFKA-2893
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2893
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 0.9.0.0
>            Reporter: Jesse Anderson
>
> When adding add seek that is a negative number, there isn't a check. When you 
> do give a negative number, you get the following output:
> {{2015-11-25 13:54:16 INFO  Fetcher:567 - Fetch offset null is out of range, 
> resetting offset}}
> Code to replicate:
> KafkaConsumer<String, String> consumer = new KafkaConsumer<String, 
> String>(props);
> TopicPartition partition = new TopicPartition(topic, 0);
> consumer.assign(Arrays.asList(partition));
> consumer.seek(partition, -1);



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

Reply via email to