[ https://issues.apache.org/jira/browse/KAFKA-8392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16868946#comment-16868946 ]
ASF GitHub Bot commented on KAFKA-8392: --------------------------------------- tuvtran commented on pull request #6977: KAFKA-8392: Fix old metrics leakage by brokers that have no leadership over any partition for a topic URL: https://github.com/apache/kafka/pull/6977 Addresses: https://issues.apache.org/jira/browse/KAFKA-8392 - Added `removeOldLeaderMetrics` in `BrokerTopicStats` to remove `MessagesInPerSec`, `BytesInPerSec`, `BytesOutPerSec` for any broker that is no longer a leader of any partition for a particular topic - Modified `ReplicaManager` to remove the metrics of any topic that the current broker has no leadership (meaning the broker either becomes a follower for all of the partitions in that topic or stops being a replica) ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Kafka broker leaks metric when partition leader moves to another node. > ---------------------------------------------------------------------- > > Key: KAFKA-8392 > URL: https://issues.apache.org/jira/browse/KAFKA-8392 > Project: Kafka > Issue Type: Bug > Components: metrics > Affects Versions: 2.2.0 > Reporter: Kamal Chandraprakash > Assignee: Tu Tran > Priority: Major > > When a partition leader moves from one node to another due to an imbalance inĀ > leader.imbalance.per.broker.percentage, the old leader broker still emits the > static metric value. > Steps to reproduce: > 1. Create a cluster with 3 nodes. > 2. Create a topic with 2 partitions and RF=3 > 3. Generate some data using the console producer. > 4. Move any one of the partition from one node to another using > reassign-partitions and preferred-replica-election script. > 5. Generate some data using the console producer. > 6. Now all the 3 nodes emit bytesIn, bytesOut and MessagesIn for that topic. > Is it the expected behavior? -- This message was sent by Atlassian JIRA (v7.6.3#76005)