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

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

Unclean leader election happens when we have to select a replica not in ISR as 
the new leader.

Thinking a bit more about this. We can patch this better. The follower can 
issue a getOffset request to the leader to get the offset of the first message 
in every segment. The follower can then pick the largest offset that is in the 
range of its local log. That offset will be used to truncate the follower's log 
and for refetching from the leader. This way, in the common case, the follower 
only has to refetch 1 segment worth of data during unclean leader election.
                
> 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: Jun Rao
>            Priority: Blocker
>              Labels: p2
>         Attachments: 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