chia7712 commented on code in PR #12979: URL: https://github.com/apache/kafka/pull/12979#discussion_r1056909612
########## core/src/main/scala/kafka/log/UnifiedLog.scala: ########## @@ -1795,10 +1803,10 @@ class UnifiedLog(@volatile var logStartOffset: Long, * remove deleted log metrics */ private[log] def removeLogMetrics(): Unit = { - removeMetric(LogMetricNames.NumLogSegments, tags) - removeMetric(LogMetricNames.LogStartOffset, tags) - removeMetric(LogMetricNames.LogEndOffset, tags) - removeMetric(LogMetricNames.Size, tags) + metricNames.foreach { + case (name, tags) => removeMetric(name, tags) + } + metricNames = Map.empty Review Comment: > Is it because when we tried to removeMetrics, the tags might become "non-future"? yep. The tags DOES NOT include "future" after the log dir get renamed. Hence, we have to keep previous metrics name in order to delete correct metrics. -- 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