HDFS-10803. TestBalancerWithMultipleNameNodes#testBalancing2OutOf3Blockpools fails intermittently due to no free space available. Contributed by Yiqun Lin.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4afd50b1 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4afd50b1 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4afd50b1 Branch: refs/heads/HDFS-7240 Commit: 4afd50b10650a72162c40cf86dea44676013f262 Parents: 91c82c9 Author: Yiqun Lin <yq...@apache.org> Authored: Tue Mar 13 10:15:51 2018 +0800 Committer: Yiqun Lin <yq...@apache.org> Committed: Tue Mar 13 10:15:51 2018 +0800 ---------------------------------------------------------------------- .../balancer/TestBalancerWithMultipleNameNodes.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/4afd50b1/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancerWithMultipleNameNodes.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancerWithMultipleNameNodes.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancerWithMultipleNameNodes.java index cf4c86f..c8929d9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancerWithMultipleNameNodes.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancerWithMultipleNameNodes.java @@ -416,13 +416,19 @@ public class TestBalancerWithMultipleNameNodes { } conf.set(DFSConfigKeys.DFS_NAMENODE_SAFEMODE_THRESHOLD_PCT_KEY, "0.0f"); + // Adjust the capacity of each DN since it will redistribute blocks + // nNameNodes times in the following operations. + long[] newCapacities = new long[nDataNodes]; + for (int i = 0; i < nDataNodes; i++) { + newCapacities[i] = capacities[i] * nNameNodes; + } { LOG.info("UNEVEN 10"); final MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf) .nnTopology(MiniDFSNNTopology.simpleFederatedTopology(nNameNodes)) .numDataNodes(nDataNodes) .racks(racks) - .simulatedCapacities(capacities) + .simulatedCapacities(newCapacities) .format(false) .build(); LOG.info("UNEVEN 11"); @@ -450,7 +456,7 @@ public class TestBalancerWithMultipleNameNodes { LOG.info("UNEVEN 13: n=" + n); } - final long totalCapacity = TestBalancer.sum(capacities); + final long totalCapacity = TestBalancer.sum(newCapacities); final long totalUsed = nNameNodes*usedSpacePerNN; LOG.info("UNEVEN 14"); runBalancer(s, totalUsed, totalCapacity); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org