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

Jun Rao commented on KAFKA-763:
-------------------------------

For 1, I think the logic in the patch is correct, but confusing. ReplicaId in 
OffsetRequest can be of three forms: (1) a value >= 0, which indicates that the 
request is from a follower and therefore logEndOffset can be returned as the 
latest offset if needed; (2) -2, which indicates that the request is from 
SimpleConsumerShell and thus allows the offset request to be served from 
non-leader; (3) -1, for other consumers and HW is returned as the latest 
offset, if needed. The confusing part is that in 
simpleConsumer.earliestOrLatestOffset(), we have both consumerId and 
isFromOrdinaryConsumer to set replicaId in the OffsetRequest. It would probably 
be simpler if the method only takes one parameter replicaId.
                
> Add an option to replica from the largest offset during unclean leader 
> election
> -------------------------------------------------------------------------------
>
>                 Key: KAFKA-763
>                 URL: https://issues.apache.org/jira/browse/KAFKA-763
>             Project: Kafka
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>            Priority: Blocker
>              Labels: kafka-0.8, p2
>             Fix For: 0.8
>
>         Attachments: kafka-763-new-v1.patch, kafka-763-new-v2.patch, 
> kafka-763_v1.patch
>
>
> If there is an unclean leader election, a follower may have an offset out of 
> the range of the leader. Currently, the follower will delete all its data and 
> refetch from the smallest offset of the leader. It would be useful to add an 
> option to let the follower refetch from the largest offset of the leader 
> since refetching from the smallest offset may take some time.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to