Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9B0C1200CBD for ; Thu, 22 Jun 2017 01:23:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 99DAA160BF3; Wed, 21 Jun 2017 23:23:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E4A82160BF6 for ; Thu, 22 Jun 2017 01:23:55 +0200 (CEST) Received: (qmail 36075 invoked by uid 500); 21 Jun 2017 23:23:53 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 35881 invoked by uid 99); 21 Jun 2017 23:23:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Jun 2017 23:23:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D7796E964C; Wed, 21 Jun 2017 23:23:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: inigoiri@apache.org To: common-commits@hadoop.apache.org Date: Wed, 21 Jun 2017 23:23:55 -0000 Message-Id: <2fbfa2d2b3fe449e9d67f6a0b7ee6f39@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [08/50] [abbrv] hadoop git commit: HDFS-11682. TestBalancer.testBalancerWithStripedFile is flaky. (lei) archived-at: Wed, 21 Jun 2017 23:23:56 -0000 HDFS-11682. TestBalancer.testBalancerWithStripedFile is flaky. (lei) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3f510872 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3f510872 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3f510872 Branch: refs/heads/HDFS-10467 Commit: 3f5108723c6272d2fded8d3563c4b793e1d88f8b Parents: 5e7cfdc Author: Lei Xu Authored: Thu Jun 15 11:04:50 2017 -0700 Committer: Lei Xu Committed: Thu Jun 15 11:04:50 2017 -0700 ---------------------------------------------------------------------- .../hdfs/server/balancer/TestBalancer.java | 44 ++++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/3f510872/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java index 016a233..ec9c39a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancer.java @@ -938,19 +938,37 @@ public class TestBalancer { throws Exception { waitForHeartBeat(totalUsedSpace, totalCapacity, client, cluster); - // start rebalancing - Collection namenodes = DFSUtil.getInternalNsRpcUris(conf); - final int r = runBalancer(namenodes, p, conf); - if (conf.getInt(DFSConfigKeys.DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY, - DFSConfigKeys.DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_DEFAULT) ==0) { - assertEquals(ExitStatus.NO_MOVE_PROGRESS.getExitCode(), r); - return; - } else { - assertEquals(ExitStatus.SUCCESS.getExitCode(), r); + int retry = 5; + while (retry > 0) { + // start rebalancing + Collection namenodes = DFSUtil.getInternalNsRpcUris(conf); + final int run = runBalancer(namenodes, p, conf); + if (conf.getInt( + DFSConfigKeys.DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY, + DFSConfigKeys.DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_DEFAULT) + == 0) { + assertEquals(ExitStatus.NO_MOVE_PROGRESS.getExitCode(), run); + return; + } else { + assertEquals(ExitStatus.SUCCESS.getExitCode(), run); + } + waitForHeartBeat(totalUsedSpace, totalCapacity, client, cluster); + LOG.info(" ."); + try { + waitForBalancer(totalUsedSpace, totalCapacity, client, cluster, p, + excludedNodes); + } catch (TimeoutException e) { + // See HDFS-11682. NN may not get heartbeat to reflect the newest + // block changes. + retry--; + if (retry == 0) { + throw e; + } + LOG.warn("The cluster has not balanced yet, retry..."); + continue; + } + break; } - waitForHeartBeat(totalUsedSpace, totalCapacity, client, cluster); - LOG.info(" ."); - waitForBalancer(totalUsedSpace, totalCapacity, client, cluster, p, excludedNodes); } private static int runBalancer(Collection namenodes, @@ -1942,7 +1960,7 @@ public class TestBalancer { doTestBalancerWithStripedFile(conf); } - @Test(timeout = 100000) + @Test(timeout = 200000) public void testBalancerWithStripedFile() throws Exception { Configuration conf = new Configuration(); initConfWithStripe(conf); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org