diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 13717196202..08a22d2b0a4 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 2f224409f94..cc233447c24 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 @@ public class Balancer { 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 */