OmniaGM commented on code in PR #14790: URL: https://github.com/apache/kafka/pull/14790#discussion_r1412455807
########## core/src/main/scala/kafka/cluster/Partition.scala: ########## @@ -613,7 +613,16 @@ class Partition(val topicPartition: TopicPartition, // Only ReplicaAlterDirThread will call this method and ReplicaAlterDirThread should remove the partition // from its partitionStates if this method returns true def maybeReplaceCurrentWithFutureReplica(): Boolean = { - // lock to prevent the log append by followers while checking if the log dir could be replaced with future log. + maybeFutureReplicaCaughtUp((futurePartitionLog: UnifiedLog) => { + logManager.replaceCurrentWithFutureLog(topicPartition) + futurePartitionLog.setLogOffsetsListener(logOffsetsListener) + log = futureLog + removeFutureLocalReplica(false) + }) + } + + def maybeFutureReplicaCaughtUp(callback: UnifiedLog => Unit): Boolean = { Review Comment: rename it. -- 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