Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-539

Fault injeciton utlis for pipeline testing needs to be refactored for future reuse by other tests

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.21.0
    • Fix Version/s: 0.21.0
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      It turns out that the current version of the helper classes introduced by HDFS-451 isn't very expendable. This JIRA is created to provide better API to this set of helper classes.

      1. HDFS-539.patch
        16 kB
        Konstantin Boudnik
      2. HDFS-539.patch
        16 kB
        Konstantin Boudnik
      3. HDFS-539.patch
        15 kB
        Konstantin Boudnik
      4. HDFS-539.patch
        15 kB
        Konstantin Boudnik
      5. HDFS-539.patch
        16 kB
        Konstantin Boudnik

        Activity

        Hide
        Konstantin Boudnik added a comment -

        The patch provides proposed modifications.

        Show
        Konstantin Boudnik added a comment - The patch provides proposed modifications.
        Hide
        Konstantin Boudnik added a comment -

        Affected tests are passing as before:

            [junit] Running org.apache.hadoop.hdfs.server.datanode.TestFiDataTransferProtocol
            [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 44.412 sec
        
        Show
        Konstantin Boudnik added a comment - Affected tests are passing as before: [junit] Running org.apache.hadoop.hdfs.server.datanode.TestFiDataTransferProtocol [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 44.412 sec
        Hide
        Konstantin Boudnik added a comment -

        Javadoc is added for a couple of new methods.
        'white space' modifications are removed (thanks Nicholas!)

        Show
        Konstantin Boudnik added a comment - Javadoc is added for a couple of new methods. 'white space' modifications are removed (thanks Nicholas!)
        Hide
        Tsz Wo Nicholas Sze added a comment -

        It may not be safe to use LocatedBlock as a key since the object content may change from time to time. How about use String?

        +    private HashMap<LocatedBlock, Pipeline> thepipeline = new HashMap<LocatedBlock, Pipeline>();
        
        Show
        Tsz Wo Nicholas Sze added a comment - It may not be safe to use LocatedBlock as a key since the object content may change from time to time. How about use String? + private HashMap<LocatedBlock, Pipeline> thepipeline = new HashMap<LocatedBlock, Pipeline>();
        Hide
        Kan Zhang added a comment -

        I may be wrong, but in your patch, are you assuming a datanode can't be in more than one pipeline simultaneously?

        Show
        Kan Zhang added a comment - I may be wrong, but in your patch, are you assuming a datanode can't be in more than one pipeline simultaneously?
        Hide
        Konstantin Boudnik added a comment -

        It may not be safe to use LocatedBlock as a key since the object content may change from time to time. How about use String?

        I may be wrong, but in your patch, are you assuming a datanode can't be in more than one pipeline simultaneously?

        Well, it wasn't an intentional assumption anyway. I think you're right and I need to change the way of creating the keys of the pipelines' cache. Update is coming.

        Show
        Konstantin Boudnik added a comment - It may not be safe to use LocatedBlock as a key since the object content may change from time to time. How about use String? I may be wrong, but in your patch, are you assuming a datanode can't be in more than one pipeline simultaneously? Well, it wasn't an intentional assumption anyway. I think you're right and I need to change the way of creating the keys of the pipelines' cache. Update is coming.
        Hide
        Konstantin Boudnik added a comment -

        This patch addresses immutability issue expressed by Nicholas.

        As for a potential problem about having the same datanode in more than a single pipeline: it doesn't seem to be a big issue in our tests. An alternative solution might be either very difficult or almost impossible to implement. One fact to consider is that client application has a different type of a DataNode's identification information than DataXceiver class, e.g. DatanodeInfo vs. DataNode. Thus it is very hard to implement a unified framework for both types - Pipeline and hflush() - tests.

        Show
        Konstantin Boudnik added a comment - This patch addresses immutability issue expressed by Nicholas. As for a potential problem about having the same datanode in more than a single pipeline: it doesn't seem to be a big issue in our tests. An alternative solution might be either very difficult or almost impossible to implement. One fact to consider is that client application has a different type of a DataNode's identification information than DataXceiver class, e.g. DatanodeInfo vs. DataNode . Thus it is very hard to implement a unified framework for both types - Pipeline and hflush() - tests.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        +1 patch looks good.

        Show
        Tsz Wo Nicholas Sze added a comment - +1 patch looks good.
        Hide
        Konstantin Boudnik added a comment -

        ClientProtocolAspects can throw NullPointerException when used by non-datatransfer oriented tests, i.e. when a test require a block to be added, although doesn't rely on DataTransferProtocol test framework.

        This version of the patch fixes it.

        Show
        Konstantin Boudnik added a comment - ClientProtocolAspects can throw NullPointerException when used by non-datatransfer oriented tests, i.e. when a test require a block to be added, although doesn't rely on DataTransferProtocol test framework. This version of the patch fixes it.
        Hide
        Konstantin Boudnik added a comment -

        Two other aspects are found to be prone to the same kind of error.
        Fixed.

        Show
        Konstantin Boudnik added a comment - Two other aspects are found to be prone to the same kind of error. Fixed.
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12416806/HDFS-539.patch
        against trunk revision 805203.

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

        +1 tests included. The patch appears to include 21 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 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.

        Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/71/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/71/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/71/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/71/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/12416806/HDFS-539.patch against trunk revision 805203. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 21 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 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. Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/71/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/71/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/71/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/71/console This message is automatically generated.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        I have committed this. Thanks, Cos!

        Show
        Tsz Wo Nicholas Sze added a comment - I have committed this. Thanks, Cos!
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #55 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/55/)
        . Refactor fault injeciton pipeline test util for future reuse. Contributed by Konstantin Boudnik

        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #55 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/55/ ) . Refactor fault injeciton pipeline test util for future reuse. Contributed by Konstantin Boudnik

          People

          • Assignee:
            Konstantin Boudnik
            Reporter:
            Konstantin Boudnik
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development