sodonnel commented on code in PR #6367:
URL: https://github.com/apache/ozone/pull/6367#discussion_r1534044125


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeDecommissionManager.java:
##########
@@ -368,6 +382,50 @@ public synchronized void startDecommission(DatanodeDetails 
dn)
     }
   }
 
+  private synchronized boolean 
checkIfDecommissionPossible(List<DatanodeDetails> dns, List<DatanodeAdminError> 
errors) {
+    // do we require method synchronization?
+    int minInService = -1; // maxRatis = -1, maxEc = -1;
+    for (DatanodeDetails dn : dns) {
+      Set<ContainerID> containers;
+      try {
+        containers = nodeManager.getContainers(dn);

Review Comment:
   It does give me some concern that this large iteration occurs in response to 
a user command. However, it does not hold any locks beyond blocking further 
decommission commands, so it is probably OK.
   
   An alternative, is to have Replication Manager track the count of containers 
per replication_type (and expose them via metrics or the container report) and 
they we could query RM for the largest number of nodes needed. However the RM 
data is always stale (runs every 5 minutes), and it cannot tell you if the 
containers on "this DN" will block. Also RM may not have ran yet after startup.



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