showuon commented on code in PR #13535: URL: https://github.com/apache/kafka/pull/13535#discussion_r1165153511
########## core/src/main/scala/kafka/server/ReplicaManager.scala: ########## @@ -1061,6 +1072,7 @@ class ReplicaManager(val config: KafkaConfig, logReadResultMap.put(topicIdPartition, logReadResult) } + val delayedRemoteFetchPurgatory: DelayedOperationPurgatory[DelayedRemoteFetch] = null; Review Comment: Why should we make `delayedRemoteFetchPurgatory` null here? We've init `delayedRemoteFetchPurgatory` in L217, and want to use it below L1131 immediately. So this line should be removed. ########## core/src/main/scala/kafka/server/ReplicaManager.scala: ########## @@ -1061,6 +1072,7 @@ class ReplicaManager(val config: KafkaConfig, logReadResultMap.put(topicIdPartition, logReadResult) } + val delayedRemoteFetchPurgatory: DelayedOperationPurgatory[DelayedRemoteFetch] = null; Review Comment: OK, I've run a test, and confirmed this line will make it throw NPE while fetching data from remote segment. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org