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

David Jacot resolved KAFKA-13767.
---------------------------------
      Reviewer: David Jacot
    Resolution: Fixed

> Fetch from consumers should return immediately when preferred read replica is 
> defined by the leader
> ---------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-13767
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13767
>             Project: Kafka
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 2.4.0
>            Reporter: zhaobo
>            Assignee: zhaobo
>            Priority: Minor
>             Fix For: 3.2.0
>
>
>  
> {code:java}
> def readFromLocalLog()
> ...
> if (preferredReadReplica.isDefined) {
>   ....
>   // If a preferred read-replica is set, skip the read
>   val offsetSnapshot = 
> partition.fetchOffsetSnapshot(fetchInfo.currentLeaderEpoch, 
> fetchOnlyFromLeader = false)
>   LogReadResult(info = FetchDataInfo(LogOffsetMetadata.UnknownOffsetMetadata, 
> MemoryRecords.EMPTY),
>     divergingEpoch = None,
>     ....
> } {code}
>  
> when  a preferred read-replica is set, skip the read ,return empty data. The 
> fetch request maybe put into the delayFetchQueue and repeat execute the 
> readFromLocalLog() . It might be better to return the response right away.



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

Reply via email to