Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-762

Trying to start the balancer throws a NPE

    Details

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

      Description

      When trying to run the balancer, I get a NullPointerException:

      2009-11-10 11:08:14,235 ERROR org.apache.hadoop.hdfs.server.balancer.Balancer: java.lang.NullPointerException
      at org.apache.hadoop.hdfs.server.namenode.BlockPlacementPolicy.getInstance(BlockPlacementPolicy.java:161)
      at org.apache.hadoop.hdfs.server.balancer.Balancer.checkReplicationPolicyCompatibility(Balancer.java:784)
      at org.apache.hadoop.hdfs.server.balancer.Balancer.<init>(Balancer.java:792)
      at org.apache.hadoop.hdfs.server.balancer.Balancer.main(Balancer.java:814)

      This happens when trying to use bin/start-balancer or bin/hdfs balancer -threshold 10

      The config files (hdfs-site and core-site) have as fs.default.name hdfs://namenode:9000.

      1. HDFS-762.patch
        4 kB
        Cristian Ivascu
      2. 0001-corrected-balancer-constructor.patch
        5 kB
        Cristian Ivascu

        Activity

        Hide
        Cristian Ivascu added a comment -

        Reverts the Balancer() constructor to do nothing. Similar to what 0.20 used. This way, when ToolRunner.run() is called, creating a new Balancer() does not cause the NPE.

        Show
        Cristian Ivascu added a comment - Reverts the Balancer() constructor to do nothing. Similar to what 0.20 used. This way, when ToolRunner.run() is called, creating a new Balancer() does not cause the NPE.
        Hide
        Cristian Ivascu added a comment -

        A more logical description of the proposed patch (cannot edit previous comment):

        The attached file contains a patch that changes the behavior of the Balancer() constructor (with no parameters) to basically do nothing (like the 0.20 version), and a test in the TestBalancer class.

        Show
        Cristian Ivascu added a comment - A more logical description of the proposed patch (cannot edit previous comment): The attached file contains a patch that changes the behavior of the Balancer() constructor (with no parameters) to basically do nothing (like the 0.20 version), and a test in the TestBalancer class.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12424526/0001-corrected-balancer-constructor.patch
        against trunk revision 834377.

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

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

        -1 patch. The patch command could not apply the patch.

        Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/69/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/12424526/0001-corrected-balancer-constructor.patch against trunk revision 834377. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 4 new or modified tests. -1 patch. The patch command could not apply the patch. Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/69/console This message is automatically generated.
        Hide
        dhruba borthakur added a comment -

        If this is a real problem with the Balancer, then can we get it into 0.21?

        Show
        dhruba borthakur added a comment - If this is a real problem with the Balancer, then can we get it into 0.21?
        Hide
        Cristian Ivascu added a comment -

        New version of the patch. Changes:
        1. correct patch format - svn diff instead of git patch
        2. removes contents of public void Balancer()
        3. adds new test in TestBalancer.java that calls Balancer() to initialize the balancer; the other tests only call Balancer(conf)

        Show
        Cristian Ivascu added a comment - New version of the patch. Changes: 1. correct patch format - svn diff instead of git patch 2. removes contents of public void Balancer() 3. adds new test in TestBalancer.java that calls Balancer() to initialize the balancer; the other tests only call Balancer(conf)
        Hide
        dhruba borthakur added a comment -

        +1. Code looks good.

        Show
        dhruba borthakur added a comment - +1. Code looks good.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12426144/HDFS-762.patch
        against trunk revision 893039.

        +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 warnings.

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

        -1 core tests. The patch failed core unit tests.

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

        Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/155/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/155/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/155/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/155/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/12426144/HDFS-762.patch against trunk revision 893039. +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 warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/155/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/155/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/155/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/155/console This message is automatically generated.
        Hide
        dhruba borthakur added a comment -

        The two failed tests are
        org.apache.hadoop.hdfs.TestClientProtocolForPipelineRecovery.testGetNewStamp
        org.apache.hadoop.hdfs.server.datanode.TestBlockReport.blockReport

        and the only change that this patch is to change the constructor of the Balancer. In no way is this test failure related to this patch. I a going to commit this patch.

        Show
        dhruba borthakur added a comment - The two failed tests are org.apache.hadoop.hdfs.TestClientProtocolForPipelineRecovery.testGetNewStamp org.apache.hadoop.hdfs.server.datanode.TestBlockReport.blockReport and the only change that this patch is to change the constructor of the Balancer. In no way is this test failure related to this patch. I a going to commit this patch.
        Hide
        dhruba borthakur added a comment -

        I just committed this. Thanks Cristian.

        Show
        dhruba borthakur added a comment - I just committed this. Thanks Cristian.
        Hide
        Hudson added a comment -

        Integrated in Hdfs-Patch-h5.grid.sp2.yahoo.net #159 (See http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/159/)
        . Balancer causes Null Pointer Exception.
        (Cristian Ivascu via dhruba)
        . Balancer causes Null Pointer Exception.
        (Cristian Ivascu via dhruba)

        Show
        Hudson added a comment - Integrated in Hdfs-Patch-h5.grid.sp2.yahoo.net #159 (See http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h5.grid.sp2.yahoo.net/159/ ) . Balancer causes Null Pointer Exception. (Cristian Ivascu via dhruba) . Balancer causes Null Pointer Exception. (Cristian Ivascu via dhruba)
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #182 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/182/)

        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #182 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/182/ )
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #158 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/158/)

        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #158 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/158/ )
        Hide
        Hudson added a comment -

        Integrated in Hdfs-Patch-h2.grid.sp2.yahoo.net #94 (See http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/94/)

        Show
        Hudson added a comment - Integrated in Hdfs-Patch-h2.grid.sp2.yahoo.net #94 (See http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-h2.grid.sp2.yahoo.net/94/ )

          People

          • Assignee:
            Cristian Ivascu
            Reporter:
            Cristian Ivascu
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development