bozhao12 opened a new pull request, #12158:
URL: https://github.com/apache/kafka/pull/12158

   Following variables in kafkaController are used for metric statistics:
   ```
      offlinePartitionCount 
       preferredReplicaImbalanceCount
       globalTopicCount 
       globalPartitionCount
       topicsToDeleteCount 
       replicasToDeleteCount 
       ineligibleTopicsToDeleteCount 
       ineligibleReplicasToDeleteCount 
   ```
   When Controller goes from active to non-active, these variables will be 
reset to 0.
   Currently, we will perform reset operations in 
`KafkaController.onControllerResignation() `and 
`KafkaController.updateMetrics()` .
   in fact, whether it is an active controller or a non-active controller, as 
long as it  receives events related to controller change, The method` 
KafkaController.updateMetrics()` will be executed, and decide whether to reset 
the above variables. So the reset operations in 
`KafkaController.onControllerResignation() ` can actually be removed.
   


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