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


##########
core/src/main/scala/kafka/log/LogManager.scala:
##########
@@ -1079,6 +1079,9 @@ class LogManager(logDirs: Seq[File],
       if (destLog == null)
         throw new KafkaStorageException(s"The future replica for 
$topicPartition is offline")
 
+      // the metrics tags still contain "future", so we have to remove it.
+      // we will add metrics back after sourceLog remove the metrics
+      destLog.removeLogMetrics()
       destLog.renameDir(UnifiedLog.logDirName(topicPartition), true)
       destLog.updateHighWatermark(sourceLog.highWatermark)

Review Comment:
   Do you think we should remove log metrics after destLog got renamed? I'm 
thinking if we got stuck for some time during `renameDir` and it'll be helpful 
to have metrics reporting it. WDYT?



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