showuon commented on code in PR #15951:
URL: https://github.com/apache/kafka/pull/15951#discussion_r1604412458


##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -2116,14 +2116,13 @@ class ReplicaManager(val config: KafkaConfig,
 
           // Add future replica log to partition's map if it's not existed
           if (partition.maybeCreateFutureReplica(futureLog.parentDir, 
offsetCheckpoints, topicIds(partition.topic))) {
-            val futureLogInPartition = 
futureLocalLogOrException(topicPartition)
             // pause cleaning for partitions that are being moved and start 
ReplicaAlterDirThread to move
             // replica from source dir to destination dir
             logManager.abortAndPauseCleaning(topicPartition)
-
-            futureReplicasAndInitialOffset.put(topicPartition, 
InitialFetchState(topicIds(topicPartition.topic), leader,
-              partition.getLeaderEpoch, futureLogInPartition.highWatermark))
           }
+
+          futureReplicasAndInitialOffset.put(topicPartition, 
InitialFetchState(topicIds(topicPartition.topic), leader,
+            partition.getLeaderEpoch, futureLog.highWatermark))

Review Comment:
   Thanks to the failing test, I found I was wrong. We should always add the 
partition into fetch thread no matter we created the future log or not since 
before `maybeAddLogDirFetchers` is called, the fetchers are all removed.



-- 
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

Reply via email to