Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-2111

Add tests for ensuring that the DN will start with a few bad data directories (Part 1 of testing DiskChecker)

    Details

    • Type: Test Test
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.23.0
    • Fix Version/s: 0.23.0
    • Component/s: datanode, test
    • Labels:
    • Hadoop Flags:
      Reviewed

      Description

      Add tests to ensure that given multiple data dirs, if a single is bad, the DN should still start up.

      This is to check DiskChecker's functionality used in instantiating DataNodes

      1. HDFS-2111.r1.diff
        3 kB
        Harsh J
      2. HDFS-2111.r1.diff
        3 kB
        Harsh J

        Issue Links

          Activity

          Hide
          Eli Collins added a comment -

          How does the proposed test differ from the similar test in TestDataNodeVolumeFailureToleration?

          Show
          Eli Collins added a comment - How does the proposed test differ from the similar test in TestDataNodeVolumeFailureToleration?
          Hide
          Harsh J added a comment -

          Eli,

          I was looking into those tests today while trying to integrate mine, and they do not seem to test the condition of a start-up failure (i.e., the DataNode#getDataDirsFromURIs method failing specifically)

          Show
          Harsh J added a comment - Eli, I was looking into those tests today while trying to integrate mine, and they do not seem to test the condition of a start-up failure (i.e., the DataNode#getDataDirsFromURIs method failing specifically)
          Hide
          Harsh J added a comment -

          Attached patch that adds a new test case to TestDataNodeVolumeFailureToleration that tests start-up DiskChecker failures as well.

          To ensure no permission issues crop up due to the patch, I did the following runs, but please review the additions and let me know if I missed some cleanup or tail fixing operation:

          ant test -Dtestcase=TestDataNodeVolumeFailureToleration
          ant test -Dtestcase=TestDataNodeVolumeFailureToleration
          ant clean
          ant test -Dtestcase=TestDataNodeVolumeFailureToleration
          

          The logs show a proper failure condition being handled:

          
          2011-06-30 23:53:01,431 WARN  datanode.DataNode (DataNode.java:getDataDirsFromURIs(2194)) - Invalid directory in: dfs.datanode.data.dir: 
          java.io.FileNotFoundException: File file:/Users/harshchouraria/Work/code/apache/hadoop/hdfs/build/test/data/dfs/badData/data2/2 does not exist.
          	at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:424)
          	at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:315)
          	at org.apache.hadoop.util.DiskChecker.mkdirsWithExistsAndPermissionCheck(DiskChecker.java:131)
          	at org.apache.hadoop.util.DiskChecker.checkDir(DiskChecker.java:148)
          	at org.apache.hadoop.hdfs.server.datanode.DataNode.getDataDirsFromURIs(DataNode.java:2191)
          	at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:2170)
          	at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2107)
          	at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2074)
          	at org.apache.hadoop.hdfs.MiniDFSCluster.startDataNodes(MiniDFSCluster.java:884)
          	at org.apache.hadoop.hdfs.MiniDFSCluster.startDataNodes(MiniDFSCluster.java:771)
          	at org.apache.hadoop.hdfs.MiniDFSCluster.startDataNodes(MiniDFSCluster.java:929)
          	at org.apache.hadoop.hdfs.server.datanode.TestDataNodeVolumeFailureToleration.testValidVolumesAtStartup(TestDataNodeVolumeFailureToleration.java:127)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          	at java.lang.reflect.Method.invoke(Method.java:597)
          

          The DN, as expected, starts alright with just one dir.

          Show
          Harsh J added a comment - Attached patch that adds a new test case to TestDataNodeVolumeFailureToleration that tests start-up DiskChecker failures as well. To ensure no permission issues crop up due to the patch, I did the following runs, but please review the additions and let me know if I missed some cleanup or tail fixing operation: ant test -Dtestcase=TestDataNodeVolumeFailureToleration ant test -Dtestcase=TestDataNodeVolumeFailureToleration ant clean ant test -Dtestcase=TestDataNodeVolumeFailureToleration The logs show a proper failure condition being handled: 2011-06-30 23:53:01,431 WARN datanode.DataNode (DataNode.java:getDataDirsFromURIs(2194)) - Invalid directory in: dfs.datanode.data.dir: java.io.FileNotFoundException: File file:/Users/harshchouraria/Work/code/apache/hadoop/hdfs/build/test/data/dfs/badData/data2/2 does not exist. at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:424) at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:315) at org.apache.hadoop.util.DiskChecker.mkdirsWithExistsAndPermissionCheck(DiskChecker.java:131) at org.apache.hadoop.util.DiskChecker.checkDir(DiskChecker.java:148) at org.apache.hadoop.hdfs.server.datanode.DataNode.getDataDirsFromURIs(DataNode.java:2191) at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:2170) at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2107) at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2074) at org.apache.hadoop.hdfs.MiniDFSCluster.startDataNodes(MiniDFSCluster.java:884) at org.apache.hadoop.hdfs.MiniDFSCluster.startDataNodes(MiniDFSCluster.java:771) at org.apache.hadoop.hdfs.MiniDFSCluster.startDataNodes(MiniDFSCluster.java:929) at org.apache.hadoop.hdfs.server.datanode.TestDataNodeVolumeFailureToleration.testValidVolumesAtStartup(TestDataNodeVolumeFailureToleration.java:127) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) The DN, as expected, starts alright with just one dir.
          Hide
          Harsh J added a comment -

          (Some imports sneaked in into the last upload, here's one updated one without those unused imports)

          Show
          Harsh J added a comment - (Some imports sneaked in into the last upload, here's one updated one without those unused imports)
          Hide
          Harsh J added a comment -

          Hoping Hudson QA has no probs with it either.

          Show
          Harsh J added a comment - Hoping Hudson QA has no probs with it either.
          Hide
          Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12484812/HDFS-2111.r1.diff
          against trunk revision 1141658.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 3 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed core unit tests.

          +1 contrib tests. The patch passed contrib unit tests.

          +1 system test framework. The patch passed system test framework compile.

          Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/871//testReport/
          Findbugs warnings: https://builds.apache.org/job/PreCommit-HDFS-Build/871//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/871//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12484812/HDFS-2111.r1.diff against trunk revision 1141658. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/871//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HDFS-Build/871//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/871//console This message is automatically generated.
          Hide
          Todd Lipcon added a comment -

          +1, lgtm. Thanks Harsh, will commit momentarily

          Show
          Todd Lipcon added a comment - +1, lgtm. Thanks Harsh, will commit momentarily
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk-Commit #775 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/775/)
          HDFS-2111. Add tests for ensuring that the DN will start with a few bad data directories. Contributed by Harsh J Chouraria.

          todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1144100
          Files :

          • /hadoop/common/trunk/hdfs/CHANGES.txt
          • /hadoop/common/trunk/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailureToleration.java
          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #775 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/775/ ) HDFS-2111 . Add tests for ensuring that the DN will start with a few bad data directories. Contributed by Harsh J Chouraria. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1144100 Files : /hadoop/common/trunk/hdfs/CHANGES.txt /hadoop/common/trunk/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailureToleration.java
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk #719 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/719/)
          HDFS-2111. Add tests for ensuring that the DN will start with a few bad data directories. Contributed by Harsh J Chouraria.

          todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1144100
          Files :

          • /hadoop/common/trunk/hdfs/CHANGES.txt
          • /hadoop/common/trunk/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailureToleration.java
          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #719 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/719/ ) HDFS-2111 . Add tests for ensuring that the DN will start with a few bad data directories. Contributed by Harsh J Chouraria. todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1144100 Files : /hadoop/common/trunk/hdfs/CHANGES.txt /hadoop/common/trunk/hdfs/src/test/hdfs/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailureToleration.java

            People

            • Assignee:
              Harsh J
              Reporter:
              Harsh J
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development