aajisaka commented on a change in pull request #3675:
URL: https://github.com/apache/hadoop/pull/3675#discussion_r770274630



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeAdminBackoffMonitor.java
##########
@@ -189,6 +190,30 @@ public void run() {
          * node will be removed from tracking by the pending cancel.
          */
         processCancelledNodes();
+
+        // Having more nodes decommissioning than can be tracked will impact 
decommissioning
+        // performance due to queueing delay
+        int numTrackedNodes = outOfServiceNodeBlocks.size();
+        int numQueuedNodes = getPendingNodes().size();
+        int numDecommissioningNodes = numTrackedNodes + numQueuedNodes;
+        if (numDecommissioningNodes > maxConcurrentTrackedNodes) {
+          LOG.warn(
+              "There are {} nodes decommissioning but only {} nodes will be 
tracked at a time. "
+                  + "{} nodes are currently queued waiting to be 
decommissioned.",
+              numDecommissioningNodes, maxConcurrentTrackedNodes, 
numQueuedNodes);
+
+          // Re-queue unhealthy nodes to make space for decommissioning 
healthy nodes
+          final List<DatanodeDescriptor> unhealthyDns = 
outOfServiceNodeBlocks.keySet().stream()
+              .filter(dn -> 
!blockManager.isNodeHealthyForDecommissionOrMaintenance(dn))
+              .collect(Collectors.toList());
+          final List<DatanodeDescriptor> toRequeue =
+              identifyUnhealthyNodesToRequeue(unhealthyDns, 
numDecommissioningNodes);
+          for (DatanodeDescriptor dn : toRequeue) {
+            getPendingNodes().add(dn);
+            outOfServiceNodeBlocks.remove(dn);

Review comment:
       Agreed. Thank you for your update.




-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to