[
https://issues.apache.org/jira/browse/KAFKA-20347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chia-Ping Tsai resolved KAFKA-20347.
------------------------------------
Fix Version/s: 4.4.0
Resolution: Fixed
> Fix metric leak and JMX tag order in ShareCoordinatorMetrics
> ------------------------------------------------------------
>
> Key: KAFKA-20347
> URL: https://issues.apache.org/jira/browse/KAFKA-20347
> Project: Kafka
> Issue Type: Bug
> Reporter: Chia-Ping Tsai
> Assignee: majialong
> Priority: Minor
> Fix For: 4.4.0
>
>
> {code:java}
> Map<String, String> tags = Map.of(
> "topic", tp.topic(),
> "partition", Integer.toString(tp.partition())
> ); {code}
> the order of `Map.of` is undefined, so the generated JMX metric names are
> unpredictable
> {code:java}
> public void deactivateMetricsShard(CoordinatorMetricsShard shard) {
> if (!(shard instanceof ShareCoordinatorMetricsShard)) {
> throw new IllegalArgumentException("ShareCoordinatorMetrics can only
> deactivate ShareCoordinatorMetricShard");
> }
> shards.remove(shard.topicPartition());
> ShareGroupPruneMetrics removed =
> pruneMetrics.remove(shard.topicPartition());
> if (removed != null) {
> metrics.removeSensor(removed.pruneSensor.name());
> }
> } {code}
> we forgot to remove the sensor when the partition leader gets changed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)