You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Chia-Ping Tsai (Jira)" <ji...@apache.org> on 2024/06/01 17:03:00 UTC
[jira] [Resolved] (KAFKA-16574) The metrics of LogCleaner disappear after reconfiguration
[ https://issues.apache.org/jira/browse/KAFKA-16574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chia-Ping Tsai resolved KAFKA-16574.
------------------------------------
Fix Version/s: 3.9.0
Resolution: Fixed
> The metrics of LogCleaner disappear after reconfiguration
> ---------------------------------------------------------
>
> Key: KAFKA-16574
> URL: https://issues.apache.org/jira/browse/KAFKA-16574
> Project: Kafka
> Issue Type: Bug
> Reporter: Chia-Ping Tsai
> Assignee: Chia Chuan Yu
> Priority: Minor
> Fix For: 3.9.0
>
>
> see [https://github.com/apache/kafka/blob/a3dcbd4e28a35f79f75ec1bf316ef0b39c0df164/core/src/main/scala/kafka/log/LogCleaner.scala#L227]
> We don't rebuild the metrics after calling shutdown. The following test can prove that.
> {code:java}
> @Test
> def testMetricsAfterReconfiguration(): Unit = {
> val logCleaner = new LogCleaner(new CleanerConfig(true),
> logDirs = Array(TestUtils.tempDir()),
> logs = new Pool[TopicPartition, UnifiedLog](),
> logDirFailureChannel = new LogDirFailureChannel(1),
> time = time)
> def check(): Unit =
> LogCleaner.MetricNames.foreach(name => assertNotNull(KafkaYammerMetrics.defaultRegistry.allMetrics().get(logCleaner.metricsGroup
> .metricName(name, java.util.Collections.emptyMap())), s"$name is gone?"))
> try {
> check()
> logCleaner.reconfigure(new KafkaConfig(TestUtils.createBrokerConfig(1, "localhost:2181")),
> new KafkaConfig(TestUtils.createBrokerConfig(1, "localhost:2181")))
> check()
> } finally logCleaner.shutdown()
> } {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)