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

zhaobo edited comment on KAFKA-13767 at 3/24/22, 7:41 AM:
----------------------------------------------------------

https://github.com/apache/kafka/pull/11942


was (Author: JIRAUSER287034):
[链接标题|https://github.com/apache/kafka/pull/11942]

> consumer fetch request does not need to put into delayFetch queue when the 
> preferred read replica not local  replica
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-13767
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13767
>             Project: Kafka
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.2.0
>            Reporter: 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