HDFS-742. A down DataNode makes Balancer to hang on repeatingly asking NameNode its partial block list. Contributed by Mit Desai.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/58db263e Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/58db263e Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/58db263e Branch: refs/heads/YARN-2915 Commit: 58db263e93daf08280e6a586a10cebd6122cf72a Parents: bebf10d Author: Kihwal Lee <kih...@apache.org> Authored: Wed Aug 3 12:14:59 2016 -0500 Committer: Kihwal Lee <kih...@apache.org> Committed: Wed Aug 3 12:14:59 2016 -0500 ---------------------------------------------------------------------- .../hadoop/hdfs/server/balancer/Dispatcher.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/58db263e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java index 9f9cdc0..16e42e0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java @@ -849,6 +849,13 @@ public class Dispatcher { + ", scheduledSize=" + getScheduledSize() + ", srcBlocks#=" + srcBlocks.size()); } + // check if time is up or not + if (Time.monotonicNow() - startTime > MAX_ITERATION_TIME) { + LOG.info("Time up (max time=" + MAX_ITERATION_TIME/1000 + + " seconds). Skipping " + this); + isTimeUp = true; + continue; + } final PendingMove p = chooseNextMove(); if (p != null) { // Reset no pending move counter @@ -886,14 +893,6 @@ public class Dispatcher { } } - // check if time is up or not - if (Time.monotonicNow() - startTime > MAX_ITERATION_TIME) { - LOG.info("Time up (max time=" + MAX_ITERATION_TIME/1000 - + " seconds). Skipping " + this); - isTimeUp = true; - continue; - } - // Now we can not schedule any block to move and there are // no new blocks added to the source block list, so we wait. try { --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org