[ 
https://issues.apache.org/jira/browse/KAFKA-13778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Jacot resolved KAFKA-13778.
---------------------------------
    Fix Version/s: 3.3.0
         Reviewer: David Jacot
       Resolution: Fixed

> Fetch from follower should never run the preferred read replica selection
> -------------------------------------------------------------------------
>
>                 Key: KAFKA-13778
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13778
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.0
>            Reporter: zhaobo
>            Assignee: zhaobo
>            Priority: Minor
>             Fix For: 3.3.0
>
>
> The design purpose of the code is that only the leader broker can determine 
> the preferred read-replica.
>  
> {code:java}
> readFromLocalLog()
> ....
> // If we are the leader, determine the preferred read-replica
> val preferredReadReplica = clientMetadata.flatMap(
>   metadata => findPreferredReadReplica(partition, metadata, replicaId, 
> fetchInfo.fetchOffset, fetchTimeMs)) {code}
>  
> But in fact, since the broker does not judge whether it is the leader or not, 
> the follower will also execute the preferred read-replica selection.
> {code:java}
> partition.leaderReplicaIdOpt.flatMap { leaderReplicaId =>
>   // Don't look up preferred for follower fetches via normal replication and
>   if (Request.isValidBrokerId(replicaId))
>     None
>   else { {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to