priyeshkaratha commented on code in PR #11809:
URL: https://github.com/apache/ozone/pull/11809#discussion_r4422675676


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeDecommissionManager.java:
##########
@@ -589,7 +589,7 @@ private synchronized boolean 
checkIfMaintenancePossible(List<DatanodeDetails> dn
           } else {
             minInService = maintenanceReplicaMinimum;
           }
-          if ((inServiceTotal - numMaintenance) < minInService) {
+          if ((inServiceTotal - healthyNodesEnteringMaintenance) < 
minInService) {
             final int unHealthyTotal = nodeManager.getAllNodeCount() - 
inServiceTotal;
             String errorMsg = "Insufficient nodes. Tried to start maintenance 
for " + dns.size() +

Review Comment:
   nit: please also print healthyNodesEnteringMaintenance here so the message 
matches the arithmetic in the check above.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeDecommissionManager.java:
##########
@@ -422,7 +422,7 @@ private synchronized boolean 
checkIfDecommissionPossible(List<DatanodeDetails> d
             continue;
           }
           int reqNodes = cif.getReplicationConfig().getRequiredNodes();
-          if ((inServiceTotal - numDecom) < reqNodes) {
+          if ((inServiceTotal - healthyNodesToDecommission) < reqNodes) {
             final int unHealthyTotal = nodeManager.getAllNodeCount() - 
inServiceTotal;
             String errorMsg = "Insufficient nodes. Tried to decommission " + 
dns.size() +

Review Comment:
    nit: now that the check subtracts healthyNodesToDecommission, the message 
is harder to reconcile with the numbers it prints. With 2 healthy nodes plus 
one STALE target, an operator sees "Tried to decommission 1 nodes out of 2 
IN-SERVICE HEALTHY … a minimum of 3 … are required", but the 1 here is not what 
was subtracted (0 was). Could we include the subtracted count so the rejection 
explains itself?



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