[ https://issues.apache.org/jira/browse/KAFKA-13767 ]
zhaobo deleted comment on KAFKA-13767: -------------------------------- was (Author: JIRAUSER287034): https://github.com/apache/kafka/pull/11942 > consumer fetch request does not need to put to delayFetch queue when the > preferred read replica not local > ----------------------------------------------------------------------------------------------------------- > > Key: KAFKA-13767 > URL: https://issues.apache.org/jira/browse/KAFKA-13767 > Project: Kafka > Issue Type: Improvement > Components: core > Affects Versions: 3.3.0 > Reporter: zhaobo > Priority: Minor > Fix For: 3.3.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. It might be better to > return the response right away -- This message was sent by Atlassian Jira (v8.20.1#820001)