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 E57CA200B12 for ; Sat, 28 May 2016 17:56:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E28E1160939; Sat, 28 May 2016 15:56:14 +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 3E9EB160A1A for ; Sat, 28 May 2016 17:56:14 +0200 (CEST) Received: (qmail 10779 invoked by uid 500); 28 May 2016 15:56:13 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 10512 invoked by uid 99); 28 May 2016 15:56:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 May 2016 15:56:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id F25172C1F5D for ; Sat, 28 May 2016 15:56:12 +0000 (UTC) Date: Sat, 28 May 2016 15:56:12 +0000 (UTC) From: "Masatake Iwasaki (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-10426) TestPendingInvalidateBlock failed in trunk MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 28 May 2016 15:56:15 -0000 [ https://issues.apache.org/jira/browse/HDFS-10426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15305449#comment-15305449 ] Masatake Iwasaki commented on HDFS-10426: ----------------------------------------- bq. And I have tested the way as you comment. But I found it still not affect the cluster.getNamesystem().getPendingDeletionBlocks(), and the invalidateBlocks will still be removed. Sorry, my assumption was wrong. {code} dfs.delete(foo, true); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(REPLICATION, cluster.getNamesystem() .getPendingDeletionBlocks()); {code} I could see 2 causes for getting {{AssertionError: expected:<2> but was:<1>}} on the above. # ReplicationMonitor kicks in between {{delete}} and checking pending deletion blocks count. # {{delete}} is called before the NN processes block report from 1 of the DNs. Your 002 patch is addressing #1 but I think it would be better to avoid adding code for testing only to BlockManager. In order to fix #2, we should wait for replication count of the block reaches to 2 before {{delete}}. > TestPendingInvalidateBlock failed in trunk > ------------------------------------------ > > Key: HDFS-10426 > URL: https://issues.apache.org/jira/browse/HDFS-10426 > Project: Hadoop HDFS > Issue Type: Bug > Components: test > Reporter: Yiqun Lin > Assignee: Yiqun Lin > Attachments: HDFS-10426.001.patch, HDFS-10426.002.patch > > > The test {{TestPendingInvalidateBlock}} failed sometimes. The stack info: > {code} > org.apache.hadoop.hdfs.server.blockmanagement.TestPendingInvalidateBlock > testPendingDeletion(org.apache.hadoop.hdfs.server.blockmanagement.TestPendingInvalidateBlock) Time elapsed: 7.703 sec <<< FAILURE! > java.lang.AssertionError: expected:<2> but was:<1> > at org.junit.Assert.fail(Assert.java:88) > at org.junit.Assert.failNotEquals(Assert.java:743) > at org.junit.Assert.assertEquals(Assert.java:118) > at org.junit.Assert.assertEquals(Assert.java:555) > at org.junit.Assert.assertEquals(Assert.java:542) > at org.apache.hadoop.hdfs.server.blockmanagement.TestPendingInvalidateBlock.testPendingDeletion(TestPendingInvalidateBlock.java:92) > {code} > It looks that the {{invalidateBlock}} has been removed before we do the check > {code} > // restart NN > cluster.restartNameNode(true); > dfs.delete(foo, true); > Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); > Assert.assertEquals(REPLICATION, cluster.getNamesystem() > .getPendingDeletionBlocks()); > Assert.assertEquals(REPLICATION, > dfs.getPendingDeletionBlocksCount()); > {code} > And I look into the related configurations. I found the property {{dfs.namenode.replication.interval}} was just set as 1 second in this test. And after the delay time of {{dfs.namenode.startup.delay.block.deletion.sec}} and the delete operation was slowly, it will cause this case. We can see the stack info before, the failed test costs 7.7s more than 5+1 second. > One way can improve this. > * Increase the time of {{dfs.namenode.replication.interval}} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org