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

Jason Gustafson commented on KAFKA-4081:
----------------------------------------

I think it definitely makes sense to reject negative values (we currently use 
-1 to indicate an invalid offset which leads to inconsistent behavior as noted 
by [~mimaison]), but rejecting offsets greater than hw seems more challenging 
since neither the client (nor the server accepting the offset commit) will 
necessarily have an up-to-date value. We could use the last hw returned from a 
previous fetch, but it might be stale by the time the user attempts to commit 
offsets. Perhaps it would make more sense to reject _any_ offset which is 
greater than the current position? It would still be possible to commit an 
invalid offset, but not without an explicit seek to that offset. However, there 
is a compatibility concern for use cases which use the consumer only for access 
to the offset API, which could be seen in offset tooling.

> Consumer API consumer new interface commitSyn does not verify the validity of 
> offset
> ------------------------------------------------------------------------------------
>
>                 Key: KAFKA-4081
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4081
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 0.9.0.1
>            Reporter: lifeng
>
> Consumer API consumer new interface commitSyn synchronization update offset, 
> for the illegal offset successful return, illegal offset<0 or offset>hw



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

Reply via email to