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

José Armando García Sancio commented on KAFKA-16530:
----------------------------------------------------

{quote}Perhaps we could revise `maybeUpdateHighWatermark` to continue to factor 
in the Leader's offset into the HW calculation
{quote}
[~alyssahuang] 

This is not correct because this will also increase the HWM when it shouldn't. 
Only the LEO of voters should be counted when computing if the HWM has 
increased. It think that the simplest algorithm is to use the voters when 
computing the HWM but don't allow the HWM to decrease the previously computed 
value if it exists.

This is okay because the only time that the HWM doesn't have a previously 
computed value is when the leader is first elected in a epoch. In that case the 
leader writes a leader change message control record to the log and waits for 
that message to get commit before computing the HWM.

> Fix high-watermark calculation to not assume the leader is in the voter set
> ---------------------------------------------------------------------------
>
>                 Key: KAFKA-16530
>                 URL: https://issues.apache.org/jira/browse/KAFKA-16530
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: kraft
>            Reporter: José Armando García Sancio
>            Assignee: Alyssa Huang
>            Priority: Major
>             Fix For: 3.8.0
>
>
> When the leader is being removed from the voter set, the leader may not be in 
> the voter set. This means that kraft should not assume that the leader is 
> part of the high-watermark calculation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to