Author: arp Date: Tue Nov 19 04:11:33 2013 New Revision: 1543304 URL: http://svn.apache.org/r1543304 Log: HDFS-5073. Merging r1543303 from trunk to branch-2
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestListCorruptFileBlocks.java Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1543304&r1=1543303&r2=1543304&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Tue Nov 19 04:11:33 2013 @@ -123,6 +123,8 @@ Release 2.3.0 - UNRELEASED HDFS-5393. Serve bootstrap and jQuery locally. (Haohui Mai via jing9) + HDFS-5073. TestListCorruptFileBlocks fails intermittently. (Arpit Agarwal) + OPTIMIZATIONS HDFS-5239. Allow FSNamesystem lock fairness to be configurable (daryn) Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestListCorruptFileBlocks.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestListCorruptFileBlocks.java?rev=1543304&r1=1543303&r2=1543304&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestListCorruptFileBlocks.java (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestListCorruptFileBlocks.java Tue Nov 19 04:11:33 2013 @@ -442,6 +442,7 @@ public class TestListCorruptFileBlocks { /** * Test if NN.listCorruptFiles() returns the right number of results. + * The corrupt blocks are detected by the BlockPoolSliceScanner. * Also, test that DFS.listCorruptFileBlocks can make multiple successive * calls. */ @@ -450,7 +451,6 @@ public class TestListCorruptFileBlocks { MiniDFSCluster cluster = null; try { Configuration conf = new HdfsConfiguration(); - conf.setInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY, 15); // datanode scans directories conf.setInt(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 3 * 1000); // datanode sends block reports cluster = new MiniDFSCluster.Builder(conf).build(); FileSystem fs = cluster.getFileSystem(); @@ -491,6 +491,13 @@ public class TestListCorruptFileBlocks { } } + // Occasionally the BlockPoolSliceScanner can run before we have removed + // the blocks. Restart the Datanode to trigger the scanner into running + // once more. + LOG.info("Restarting Datanode to trigger BlockPoolSliceScanner"); + cluster.restartDataNodes(); + cluster.waitActive(); + badFiles = namenode.getNamesystem().listCorruptFileBlocks("/srcdat2", null);