From cefa21e98a12b06602ee8000f8cef6c3b17af999 Mon Sep 17 00:00:00 2001 From: Tsz-Wo Nicholas Sze Date: Thu, 4 Aug 2016 09:45:40 -0700 Subject: [PATCH] In Balancer, the target task should be removed when its size < 0. Contributed by Yiqun Lin --- .../java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8f81c19236c..9bf549a059b 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 @@ -734,7 +734,7 @@ public class Dispatcher { long blockSize = pendingBlock.block.getNumBytes(); incScheduledSize(-blockSize); task.size -= blockSize; - if (task.size == 0) { + if (task.size <= 0) { i.remove(); } return pendingBlock;