OmniaGM commented on code in PR #14881:
URL: https://github.com/apache/kafka/pull/14881#discussion_r1415609251


##########
core/src/main/scala/kafka/cluster/Partition.scala:
##########
@@ -867,6 +869,25 @@ class Partition(val topicPartition: TopicPartition,
     }
   }
 
+  private def createLogInAssignedDirectoryId(partitionState: 
LeaderAndIsrPartitionState, highWatermarkCheckpoints: OffsetCheckpoints, 
topicId: Option[Uuid], targetLogDirectoryId: Option[Uuid]): Unit = {
+    targetLogDirectoryId match {
+      case Some(directoryId) =>
+        if (logManager.onlineLogDirId(directoryId)) {
+          if (logManager.getLog(topicPartition).isEmpty) {
+            createLogIfNotExists(partitionState.isNew, isFutureReplica = 
false, highWatermarkCheckpoints, topicId, targetLogDirectoryId)
+          }

Review Comment:
   The `else` means it just existed somewhere and we don't need to create it. 
It doesn't matter if it exists on this log dir or another at this point. 
ReplicaManager will decide later to send the reassignment if partition.log != 
assigned log. I added an else with log.info that the topic existed before 
somewhere. 



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