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


##########
core/src/main/scala/kafka/log/LogManager.scala:
##########
@@ -1156,6 +1156,32 @@ class LogManager(logDirs: Seq[File],
     }
   }
 
+  def maybeRecoverAbandonedFutureLog(topicPartition: TopicPartition, 
partitionAssignedDirectoryId: Option[Uuid], callback: () => Unit): Unit = {
+    logCreationOrDeletionLock synchronized {
+      for {
+        futureLog <- getLog(topicPartition, isFuture = true)
+        futureDirId <- directoryId(futureLog.parentDir)
+        assignedDirId <- partitionAssignedDirectoryId
+        if futureDirId == assignedDirId
+      } {
+        val sourceLog = futureLog

Review Comment:
   `sourceLog` can be moved into the `for` block. 



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