[
https://issues.apache.org/jira/browse/KAFKA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15159732#comment-15159732
]
Monal Daxini commented on KAFKA-3271:
-------------------------------------
If there is an api to query a broker (leader of a partition) what the offset is
when it became a leader is good enough, even if the consumer is not notified.
When an invalid offset exception is encountered a client can make a leader
offset metadata request for the specific topic and partition.
> Notification upon unclean leader election
> -----------------------------------------
>
> Key: KAFKA-3271
> URL: https://issues.apache.org/jira/browse/KAFKA-3271
> Project: Kafka
> Issue Type: New Feature
> Components: clients, core
> Reporter: Yasuhiro Matsuda
> Priority: Minor
>
> It is a legitimate restriction that unclean leader election results in some
> message loss. That said, it is always good to try to minimize the message
> loss. A notification of unclean leader election can reduce message loss in
> the following scenario.
> 1. The latest offset is L.
> 2. A consumer is at C, where C < L
> 3. A slow broker (not in ISR) is at S, where S < C
> 4. All brokers in ISR die.
> 5. The slow broker becomes a leader by unclean leader election.
> 6. Now the offset of S.
> 7. The new messages get offsets S, S+1, S+2, and so on.
> Currently the consumer won't receive new messages of offsets between S and C.
> However, if the consumer is notified when unclean leader election happened
> and resets its offset to S, it can receive new messages between S and C.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)