adoroszlai commented on code in PR #7471:
URL: https://github.com/apache/ozone/pull/7471#discussion_r1861645323


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java:
##########


Review Comment:
   I think changes in this file are no longer needed, since the new test case 
uses 0 datanodes.
   
   We'll need to revisit datanode version mocking separately.  (HDDS-11819)



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java:
##########
@@ -1595,8 +1595,12 @@ public void start() throws IOException {
 
     setStartTime();
 
-    // At this point leader is not known
-    scmHAMetricsUpdate(null);
+    if (SCMHAUtils.isSCMHAEnabled(configuration) && 
getScmHAManager().getRatisServer().getLeaderId() != null) {
+      
scmHAMetricsUpdate(getScmHAManager().getRatisServer().getLeaderId().toString());
+    } else {
+      // At this point leader is not known
+      scmHAMetricsUpdate(null);
+    }

Review Comment:
   Sorry, I didn't notice this earlier.  Please call `getLeaderId()` once, and 
use it in both the condition and to update metrics.
   
   ```suggestion
       RaftPeerId leaderId = SCMHAUtils.isSCMHAEnabled(configuration)
           ? getScmHAManager().getRatisServer().getLeaderId()
           : null;
       scmHAMetricsUpdate(Objects.toString(leaderId, null));
   ```



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

Reply via email to