xBis7 commented on PR #4140: URL: https://github.com/apache/ozone/pull/4140#issuecomment-1433003906
@neils-dev Double checking the `leaderId` seems unecessary. If for some reason there is no leader or there is an error and `leaderId` is empty, then the state is set to 0 pointing that the current node is a follower, which will be true. I hadn't thought about the case where ratis is disabled but I looked into it and tested it. Since, in that scenario there are no leaders or followers, `updatePeerList()` never gets called and therefore `OMHAMetrics` are not registered. Checking if ratis is enabled is redundant because if it isn't and the method gets called we will get a NPE at the very first line when calling `omRatisServer`. -- 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]
