From c6497949e866594050153b953a85c0a1db59d2f8 Mon Sep 17 00:00:00 2001 From: cnauroth Date: Fri, 5 Feb 2016 15:07:43 -0800 Subject: [PATCH] HDFS-9761. Rebalancer sleeps too long between iterations. Contributed by Mingliang Liu. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/server/balancer/Balancer.java | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 44cbcc5575..80be32399e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/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 diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java index 2bd28ab83b..927fb7fbcc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java @@ -674,14 +674,13 @@ static int run(Collection namenodes, final BalancerParameters p, // 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) {