nandakumar131 commented on code in PR #8331:
URL: https://github.com/apache/ozone/pull/8331#discussion_r2068390762


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/DataNodeSafeModeRule.java:
##########
@@ -66,7 +69,17 @@ protected boolean validate() {
     if (validateBasedOnReportProcessing()) {
       return registeredDns >= requiredDns;
     }
-    return nodeManager.getNodes(NodeStatus.inServiceHealthy()).size() >= 
requiredDns;
+
+    int healthyCount = 
nodeManager.getNodes(NodeStatus.inServiceHealthy()).size();
+    int healthyReadOnlyCount = 
nodeManager.getNodes(NodeStatus.inServiceHealthyReadOnly()).size();
+    int staleCount = nodeManager.getNodes(NodeStatus.inServiceStale()).size();
+
+    if (healthyCount + healthyReadOnlyCount + staleCount == 1) {
+      LOG.warn("Only one Datanode is available in the cluster. " +
+          "Consider setting 'hdds.scm.safemode.min.datanode=1' in the 
configuration.");
+    }

Review Comment:
   SCM doesn't remember Datanode list across SCM restart. So during SCM 
restart, initially the datanode list in SCM will be empty and at some point the 
first Datanode will register making `(healthyCount + healthyReadOnlyCount + 
staleCount == 1)` to true and printing the `warn` log message.
   
   We will end up printing this `warn` log message during every SCM start-up.



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