xijiu commented on code in PR #17563:
URL: https://github.com/apache/kafka/pull/17563#discussion_r1810103650


##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -469,14 +469,18 @@ class ReplicaManager(val config: KafkaConfig,
     })
   }
 
-  private def completeDelayedOperationsWhenNotPartitionLeader(topicPartition: 
TopicPartition, topicId: Option[Uuid]): Unit = {
+  private def completeDelayedOperationsWhenNotPartitionLeader(topicPartition: 
TopicPartition, topicId: Option[Uuid],
+                                                              isStopReplica: 
Boolean): Unit = {
     val topicPartitionOperationKey = TopicPartitionOperationKey(topicPartition)
     delayedProducePurgatory.checkAndComplete(topicPartitionOperationKey)
-    delayedFetchPurgatory.checkAndComplete(topicPartitionOperationKey)
-    delayedRemoteFetchPurgatory.checkAndComplete(topicPartitionOperationKey)
-    
delayedRemoteListOffsetsPurgatory.checkAndComplete(topicPartitionOperationKey)
-    if (topicId.isDefined) delayedShareFetchPurgatory.checkAndComplete(
-      new DelayedShareFetchPartitionKey(topicId.get, 
topicPartition.partition()))
+    // We support fetch from follower now, So only 'stop reply' requires the 
following things
+    if (isStopReplica) {
+      delayedFetchPurgatory.checkAndComplete(topicPartitionOperationKey)

Review Comment:
   @m1a2st  Thanks very much for code review, I will check the failed test 
cases and make some modifications.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to