HBase
  1. HBase
  2. HBASE-5928

Hbck shouldn't npe when there are no tables.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.92.1, 0.94.0, 0.95.2
    • Fix Version/s: 0.94.1, 0.95.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      hbase fsck errors out when there are no tables.

      Exception in thread "main" java.lang.NullPointerException
      at org.apache.hadoop.hbase.util.HBaseFsck.reportTablesInFlux(HBaseFsck.java:560)
      at org.apache.hadoop.hbase.util.HBaseFsck.onlineConsistencyRepair(HBaseFsck.java:346)
      at org.apache.hadoop.hbase.util.HBaseFsck.onlineHbck(HBaseFsck.java:382)
      at org.apache.hadoop.hbase.util.HBaseFsck.main(HBaseFsck.java:3120)

      1. HBASE-5928-0.patch
        0.7 kB
        Elliott Clark
      2. HBASE-5928-1.patch
        1 kB
        Elliott Clark
      3. hbase-5928-94.patch
        1 kB
        Jonathan Hsieh

        Activity

        Hide
        liuli added a comment -

        Hi Jonathan. Now the environment is being used by others. I will keep in mind, and when I could, I will double check what you said
        Yes, I opened a new issue HBASE-6500, if you need, I could close that one and only trace the status here

        Anyway, I will keep you posted!

        Show
        liuli added a comment - Hi Jonathan. Now the environment is being used by others. I will keep in mind, and when I could, I will double check what you said Yes, I opened a new issue HBASE-6500 , if you need, I could close that one and only trace the status here Anyway, I will keep you posted!
        Hide
        Jonathan Hsieh added a comment -

        liuli Did you open a new issue, HBASE-6500, to address your 02/Aug/12 02:21 comment?

        Show
        Jonathan Hsieh added a comment - liuli Did you open a new issue, HBASE-6500 , to address your 02/Aug/12 02:21 comment?
        Hide
        Jonathan Hsieh added a comment - - edited

        liuli Is it essentially exactly the same error in exactly the same spot? can you double check to make sure that you didn't accidentally use the wrong jar?

        Show
        Jonathan Hsieh added a comment - - edited liuli Is it essentially exactly the same error in exactly the same spot? can you double check to make sure that you didn't accidentally use the wrong jar?
        Hide
        liuli added a comment -

        I have apply the patch, but I still meet the same question

        The version is :

        Hadoop 0.20.205.0
        Zookeeper: zookeeper-3.3.5.jar
        Hbase: hbase-0.94.0

        If you need any log, let me know

        Show
        liuli added a comment - I have apply the patch, but I still meet the same question The version is : Hadoop 0.20.205.0 Zookeeper: zookeeper-3.3.5.jar Hbase: hbase-0.94.0 If you need any log, let me know
        Hide
        Hudson added a comment -

        Integrated in HBase-0.92-security #106 (See https://builds.apache.org/job/HBase-0.92-security/106/)
        HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333693)

        Result = SUCCESS
        jmhsieh :
        Files :

        • /hbase/branches/0.92/CHANGES.txt
        • /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
        • /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Show
        Hudson added a comment - Integrated in HBase-0.92-security #106 (See https://builds.apache.org/job/HBase-0.92-security/106/ ) HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333693) Result = SUCCESS jmhsieh : Files : /hbase/branches/0.92/CHANGES.txt /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Hide
        Hudson added a comment -

        Integrated in HBase-0.94-security #26 (See https://builds.apache.org/job/HBase-0.94-security/26/)
        HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333692)

        Result = SUCCESS
        jmhsieh :
        Files :

        • /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
        • /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Show
        Hudson added a comment - Integrated in HBase-0.94-security #26 (See https://builds.apache.org/job/HBase-0.94-security/26/ ) HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333692) Result = SUCCESS jmhsieh : Files : /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Hide
        Hudson added a comment -

        Integrated in HBase-TRUNK-security #191 (See https://builds.apache.org/job/HBase-TRUNK-security/191/)
        HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333691)

        Result = SUCCESS
        jmhsieh :
        Files :

        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Show
        Hudson added a comment - Integrated in HBase-TRUNK-security #191 (See https://builds.apache.org/job/HBase-TRUNK-security/191/ ) HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333691) Result = SUCCESS jmhsieh : Files : /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Hide
        Hudson added a comment -

        Integrated in HBase-0.92 #397 (See https://builds.apache.org/job/HBase-0.92/397/)
        HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333693)

        Result = SUCCESS
        jmhsieh :
        Files :

        • /hbase/branches/0.92/CHANGES.txt
        • /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
        • /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Show
        Hudson added a comment - Integrated in HBase-0.92 #397 (See https://builds.apache.org/job/HBase-0.92/397/ ) HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333693) Result = SUCCESS jmhsieh : Files : /hbase/branches/0.92/CHANGES.txt /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Hide
        Hudson added a comment -

        Integrated in HBase-TRUNK #2846 (See https://builds.apache.org/job/HBase-TRUNK/2846/)
        HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333691)

        Result = SUCCESS
        jmhsieh :
        Files :

        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Show
        Hudson added a comment - Integrated in HBase-TRUNK #2846 (See https://builds.apache.org/job/HBase-TRUNK/2846/ ) HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333691) Result = SUCCESS jmhsieh : Files : /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Hide
        Hudson added a comment -

        Integrated in HBase-0.94 #177 (See https://builds.apache.org/job/HBase-0.94/177/)
        HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333692)

        Result = SUCCESS
        jmhsieh :
        Files :

        • /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
        • /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Show
        Hudson added a comment - Integrated in HBase-0.94 #177 (See https://builds.apache.org/job/HBase-0.94/177/ ) HBASE-5928 Hbck shouldn't npe when there are no tables (Elliott Clark) (Revision 1333692) Result = SUCCESS jmhsieh : Files : /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
        Hide
        Jonathan Hsieh added a comment -

        Thanks Elliott!

        Show
        Jonathan Hsieh added a comment - Thanks Elliott!
        Hide
        Hadoop QA added a comment -

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

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

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 hadoop23. The patch compiles against the hadoop 0.23.x profile.

        +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 unit tests in .

        Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/1754//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/1754//artifact/trunk/patchprocess/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1754//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/12525529/HBASE-5928-1.patch against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 hadoop23. The patch compiles against the hadoop 0.23.x profile. +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 unit tests in . Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/1754//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/1754//artifact/trunk/patchprocess/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1754//console This message is automatically generated.
        Hide
        Jonathan Hsieh added a comment -

        -94 version applies to 0.92 and 0.94

        Show
        Jonathan Hsieh added a comment - -94 version applies to 0.92 and 0.94
        Hide
        Elliott Clark added a comment -

        Of course.

        Show
        Elliott Clark added a comment - Of course.
        Hide
        Jonathan Hsieh added a comment -

        Elliot, are you willing to make the change in the HBaseFsck#getHTableDescriptors method so that instead of being initialized to null it is initialized to empty array?

        For some reason I thought I had modified that method in that exact place to return empty array already in a previous patch.

        Show
        Jonathan Hsieh added a comment - Elliot, are you willing to make the change in the HBaseFsck#getHTableDescriptors method so that instead of being initialized to null it is initialized to empty array? For some reason I thought I had modified that method in that exact place to return empty array already in a previous patch.
        Hide
        Jimmy Xiang added a comment -

        +1

        Show
        Jimmy Xiang added a comment - +1
        Hide
        Todd Lipcon added a comment -

        Seems innocuous enough to me... any other opinions?

        Show
        Todd Lipcon added a comment - Seems innocuous enough to me... any other opinions?
        Hide
        Elliott Clark added a comment -

        Mainly I did this because changing behavior of HBaseAdmin.getTableDescriptors seemed like it might break anyone who expects null to mean no tables. However if a breaking change is ok it's a pretty easy change.

        Show
        Elliott Clark added a comment - Mainly I did this because changing behavior of HBaseAdmin.getTableDescriptors seemed like it might break anyone who expects null to mean no tables. However if a breaking change is ok it's a pretty easy change.
        Hide
        Todd Lipcon added a comment -

        Why not make it return an empty list instead? Returning null instead of empty collections is just begging for bugs like this.

        Show
        Todd Lipcon added a comment - Why not make it return an empty list instead? Returning null instead of empty collections is just begging for bugs like this.
        Hide
        Elliott Clark added a comment -

        I looped TestAssignmentManager several times locally and it always passes.

        Show
        Elliott Clark added a comment - I looped TestAssignmentManager several times locally and it always passes.
        Hide
        stack added a comment -

        +1 on patch.

        Jon Hsieh?

        Show
        stack added a comment - +1 on patch. Jon Hsieh?
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12525489/HBASE-5928-0.patch
        against trunk revision .

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

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 hadoop23. The patch compiles against the hadoop 0.23.x profile.

        +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 failed these unit tests:
        org.apache.hadoop.hbase.master.TestAssignmentManager

        Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/1748//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/1748//artifact/trunk/patchprocess/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1748//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/12525489/HBASE-5928-0.patch against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 hadoop23. The patch compiles against the hadoop 0.23.x profile. +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 failed these unit tests: org.apache.hadoop.hbase.master.TestAssignmentManager Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/1748//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/1748//artifact/trunk/patchprocess/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/1748//console This message is automatically generated.
        Hide
        Elliott Clark added a comment -

        Pretty small patch.
        HConnectionManager.getHTableDescriptors returns null when there are no tables.

        I assumed this was expected so handling the null is needed.

        Show
        Elliott Clark added a comment - Pretty small patch. HConnectionManager.getHTableDescriptors returns null when there are no tables. I assumed this was expected so handling the null is needed.

          People

          • Assignee:
            Elliott Clark
            Reporter:
            Elliott Clark
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development