kostacie commented on code in PR #8331:
URL: https://github.com/apache/ozone/pull/8331#discussion_r2073162332
##########
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:
Thank you for the review @nandakumar131. Should we add a flag that would
indicate that the log message has already been printed? Would it be a good
solution?
Or would you recommend anything to avoid such problem?
--
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]