diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 1371719620..08a22d2b0a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1733,6 +1733,9 @@ Release 0.22.0 - Unreleased HDFS-2290. Block with corrupt replica is not getting replicated. (Benoy Antony via shv) + HDFS-2012. Balancer incorrectly treats nodes whose utilization equals + avgUtilization. (Uma Maheswara Rao G via shv) + Release 0.21.1 - Unreleased HDFS-1466. TestFcHdfsSymlink relies on /tmp/test not existing. (eli) 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 2f224409f9..cc233447c2 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 @@ -1261,12 +1261,12 @@ private boolean isOverUtilized(BalancerDatanode datanode) { return datanode.utilization > (policy.getAvgUtilization()+threshold); } - /* Return true if the given datanode is above average utilized + /* Return true if the given datanode is above or equal to average utilized * but not overUtilized */ private boolean isAboveAvgUtilized(BalancerDatanode datanode) { final double avg = policy.getAvgUtilization(); return (datanode.utilization <= (avg+threshold)) - && (datanode.utilization > avg); + && (datanode.utilization >= avg); } /* Return true if the given datanode is underUtilized */