Parcourir la source

HDFS-9761. Rebalancer sleeps too long between iterations. Contributed by Mingliang Liu.

cnauroth il y a 9 ans
Parent
commit
c6497949e8

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -2704,6 +2704,9 @@ Release 2.8.0 - UNRELEASED
     HDFS-9601. NNThroughputBenchmark.BlockReportStats should handle
     NotReplicatedYetException on adding block (iwasakims)
 
+    HDFS-9761. Rebalancer sleeps too long between iterations
+    (Mingliang Liu via cnauroth)
+
 Release 2.7.3 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 3 - 4
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java

@@ -674,14 +674,13 @@ public class Balancer {
               // must be an error statue, return.
               return r.exitStatus.getExitCode();
             }
-
-            if (!done) {
-              Thread.sleep(sleeptime);
-            }
           } else {
             LOG.info("Skipping blockpool " + nnc.getBlockpoolID());
           }
         }
+        if (!done) {
+          Thread.sleep(sleeptime);
+        }
       }
     } finally {
       for(NameNodeConnector nnc : connectors) {