HBase
  1. HBase
  2. HBASE-5455

Add test to avoid unintentional reordering of items in HbaseObjectWritable

    Details

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

      Description

      HbaseObjectWritable has a static initialization block that assigns ints to various classes. The int is assigned by using a local variable that is incremented after each use. If someone adds a line in the middle of the block, this throws off everything after the change, and can break client compatibility. There is already a comment to not add/remove lines at the beginning of this block. It might make sense to have a test against a static set of ids. If something gets changed unintentionally, it would at least fail the tests. If the change was intentional, at the very least the test would need to get updated, and it would be a conscious decision.

      https://issues.apache.org/jira/browse/HBASE-5204 contains the the fix for one issue of this type.

      1. HBASE-5455.diff
        13 kB
        Michael Drzal

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Patch Available Patch Available Open Open
        35s 1 Michael Drzal 24/Feb/12 14:37
        Open Open Patch Available Patch Available
        1d 22h 48m 2 Lars Hofhansl 24/Feb/12 18:39
        Patch Available Patch Available Resolved Resolved
        3h 50m 1 Lars Hofhansl 24/Feb/12 22:30
        Resolved Resolved Closed Closed
        230d 7h 5m 1 Lars Hofhansl 12/Oct/12 05:35
        Lars Hofhansl made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Hudson added a comment -

        Integrated in HBase-TRUNK #2669 (See https://builds.apache.org/job/HBase-TRUNK/2669/)
        HBASE-5455 Add test to avoid unintentional reordering of items in HbaseObjectWritable (Michael Drzal) (Revision 1293455)

        Result = SUCCESS
        larsh :
        Files :

        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java
        • /hbase/trunk/src/test/java/org/apache/hadoop/hbase/io/TestHbaseObjectWritable.java
        Show
        Hudson added a comment - Integrated in HBase-TRUNK #2669 (See https://builds.apache.org/job/HBase-TRUNK/2669/ ) HBASE-5455 Add test to avoid unintentional reordering of items in HbaseObjectWritable (Michael Drzal) (Revision 1293455) Result = SUCCESS larsh : Files : /hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java /hbase/trunk/src/test/java/org/apache/hadoop/hbase/io/TestHbaseObjectWritable.java
        Hide
        Hudson added a comment -

        Integrated in HBase-TRUNK-security #122 (See https://builds.apache.org/job/HBase-TRUNK-security/122/)
        HBASE-5455 Add test to avoid unintentional reordering of items in HbaseObjectWritable (Michael Drzal) (Revision 1293455)

        Result = FAILURE
        larsh :
        Files :

        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java
        • /hbase/trunk/src/test/java/org/apache/hadoop/hbase/io/TestHbaseObjectWritable.java
        Show
        Hudson added a comment - Integrated in HBase-TRUNK-security #122 (See https://builds.apache.org/job/HBase-TRUNK-security/122/ ) HBASE-5455 Add test to avoid unintentional reordering of items in HbaseObjectWritable (Michael Drzal) (Revision 1293455) Result = FAILURE larsh : Files : /hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/HbaseObjectWritable.java /hbase/trunk/src/test/java/org/apache/hadoop/hbase/io/TestHbaseObjectWritable.java
        Lars Hofhansl made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Resolution Fixed [ 1 ]
        Hide
        Lars Hofhansl added a comment -

        Committed to trunk. Thanks for idea and patch!

        Show
        Lars Hofhansl added a comment - Committed to trunk. Thanks for idea and patch!
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12515922/HBASE-5455.diff
        against trunk revision .

        +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 appears to have generated -133 warning messages.

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

        -1 findbugs. The patch appears to introduce 155 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 failed these unit tests:
        org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat
        org.apache.hadoop.hbase.mapred.TestTableMapReduce
        org.apache.hadoop.hbase.mapreduce.TestImportTsv

        Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/1043//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/1043//artifact/trunk/patchprocess/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1043//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/12515922/HBASE-5455.diff against trunk revision . +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 appears to have generated -133 warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. -1 findbugs. The patch appears to introduce 155 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 failed these unit tests: org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat org.apache.hadoop.hbase.mapred.TestTableMapReduce org.apache.hadoop.hbase.mapreduce.TestImportTsv Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/1043//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/1043//artifact/trunk/patchprocess/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1043//console This message is automatically generated.
        Hide
        stack added a comment -

        +1 Excellent

        Show
        stack added a comment - +1 Excellent
        Lars Hofhansl made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Assignee Michael Drzal [ mdrzal ]
        Michael Drzal made changes -
        Attachment HBASE-5455.diff [ 12515922 ]
        Hide
        Michael Drzal added a comment -

        Updated TestHbaseObjectWritable to error on class code changes that would affect the wire protocol.

        Show
        Michael Drzal added a comment - Updated TestHbaseObjectWritable to error on class code changes that would affect the wire protocol.
        Michael Drzal made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Michael Drzal made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Michael Drzal added a comment -

        Added a test case for class to int mapping in HbaseObjectWritable to ensure wire compatibility.

        Show
        Michael Drzal added a comment - Added a test case for class to int mapping in HbaseObjectWritable to ensure wire compatibility.
        Hide
        Michael Drzal added a comment -

        Lars, sure, let me throw something together, and I'll send it your way.

        Show
        Michael Drzal added a comment - Lars, sure, let me throw something together, and I'll send it your way.
        Hide
        Lars Hofhansl added a comment -

        Drz, do you want to do a patch for this?
        We can review internally first if you like.

        Show
        Lars Hofhansl added a comment - Drz, do you want to do a patch for this? We can review internally first if you like.
        Hide
        stack added a comment -

        Good idea.

        Show
        stack added a comment - Good idea.
        Lars Hofhansl made changes -
        Field Original Value New Value
        Fix Version/s 0.94.0 [ 12316419 ]
        Michael Drzal created issue -

          People

          • Assignee:
            Michael Drzal
            Reporter:
            Michael Drzal
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development