浏览代码

In Balancer, the target task should be removed when its size < 0. Contributed by Yiqun Lin

(cherry picked from commit cefa21e98a12b06602ee8000f8cef6c3b17af999)
Tsz-Wo Nicholas Sze 9 年之前
父节点
当前提交
9afc6615b0

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Dispatcher.java

@@ -716,7 +716,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;