errose28 commented on PR #12218: URL: https://github.com/apache/ozone/pull/12218#issuecomment-7353882546
I went with a similar direction: give the metrics an `ScmContext` instance, which is used throughout SCM by components that need to check leadership. Additionally: - Kept the order of operations in `SCMStateMachine#notifyLeaderChanged` but added explicit if/else blocks for leader/follower so the previous early return can't cause a similar bug in the future. - Used `MetricUtil#getMetricsSourceName` to pick the metric source name, which assigns different source names for nodes in mini clusters. Same pattern as `SCMMetrics`. - Removed the now unnecessary internal class `SCMHAMetricsInfo`. - Ensure a new leader is actually chosen in `TestStorageContainerManagerHA`. `OMHAMetrics` are also being recreated on leader change so we should do a similar change there once this is finalized. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
