HBase
  1. HBase
  2. HBASE-8710

The balancer shouldn't try balancing one node

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.95.1
    • Fix Version/s: 0.98.0, 0.96.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      The balancer will not try balancing the regions when there's only one node.

      Description

      In my logs, testing 0.95.1 RC1, I see:

      2013-06-07 17:31:47,377 DEBUG [ip-10-20-46-44.novalocal,48569,1370640098134-BalancerChore] balancer.StochasticLoadBalancer: Could not find a better load balance plan.  Tried 3200 different configurations in 27ms, and did not find anything with a computed cost less than 25.0
      

      Ideally we'd not even try one configuration, let alone 3.2k.

      1. HBASE-8710-1.patch
        4 kB
        James Kinley
      2. HBASE-8710-2.patch
        1 kB
        Jean-Daniel Cryans
      3. HBASE-8710-3.patch
        1 kB
        James Kinley

        Activity

        Hide
        Hudson added a comment -

        FAILURE: Integrated in hbase-0.96-hadoop2 #70 (See https://builds.apache.org/job/hbase-0.96-hadoop2/70/)
        HBASE-8710 The balancer shouldn't try balancing one node (James Kinley via JD) (jdcryans: rev 1528563)

        • /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
        Show
        Hudson added a comment - FAILURE: Integrated in hbase-0.96-hadoop2 #70 (See https://builds.apache.org/job/hbase-0.96-hadoop2/70/ ) HBASE-8710 The balancer shouldn't try balancing one node (James Kinley via JD) (jdcryans: rev 1528563) /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in HBase-TRUNK-on-Hadoop-2.0.0 #773 (See https://builds.apache.org/job/HBase-TRUNK-on-Hadoop-2.0.0/773/)
        HBASE-8710 The balancer shouldn't try balancing one node (James Kinley via JD) (jdcryans: rev 1528564)

        • /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
        Show
        Hudson added a comment - SUCCESS: Integrated in HBase-TRUNK-on-Hadoop-2.0.0 #773 (See https://builds.apache.org/job/HBase-TRUNK-on-Hadoop-2.0.0/773/ ) HBASE-8710 The balancer shouldn't try balancing one node (James Kinley via JD) (jdcryans: rev 1528564) /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
        Hide
        Hudson added a comment -

        FAILURE: Integrated in HBase-TRUNK #4584 (See https://builds.apache.org/job/HBase-TRUNK/4584/)
        HBASE-8710 The balancer shouldn't try balancing one node (James Kinley via JD) (jdcryans: rev 1528564)

        • /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
        Show
        Hudson added a comment - FAILURE: Integrated in HBase-TRUNK #4584 (See https://builds.apache.org/job/HBase-TRUNK/4584/ ) HBASE-8710 The balancer shouldn't try balancing one node (James Kinley via JD) (jdcryans: rev 1528564) /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in hbase-0.96 #116 (See https://builds.apache.org/job/hbase-0.96/116/)
        HBASE-8710 The balancer shouldn't try balancing one node (James Kinley via JD) (jdcryans: rev 1528563)

        • /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
        Show
        Hudson added a comment - SUCCESS: Integrated in hbase-0.96 #116 (See https://builds.apache.org/job/hbase-0.96/116/ ) HBASE-8710 The balancer shouldn't try balancing one node (James Kinley via JD) (jdcryans: rev 1528563) /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
        Hide
        Jean-Daniel Cryans added a comment -

        Committed to branch and trunk. Thanks for the patches James and for the reviews Elliott!

        Show
        Jean-Daniel Cryans added a comment - Committed to branch and trunk. Thanks for the patches James and for the reviews Elliott!
        Hide
        Elliott Clark added a comment -

        +1

        Show
        Elliott Clark added a comment - +1
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12606264/HBASE-8710-3.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 hadoop1.0. The patch compiles against the hadoop 1.0 profile.

        +1 hadoop2.0. The patch compiles against the hadoop 2.0 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 lineLengths. The patch does not introduce lines longer than 100

        +1 site. The mvn site goal succeeds with this patch.

        -1 core tests. The patch failed these unit tests:
        org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat

        Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-prefix-tree.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-client.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-protocol.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop1-compat.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-examples.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-thrift.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html
        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//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/12606264/HBASE-8710-3.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 hadoop1.0 . The patch compiles against the hadoop 1.0 profile. +1 hadoop2.0 . The patch compiles against the hadoop 2.0 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 lineLengths . The patch does not introduce lines longer than 100 +1 site . The mvn site goal succeeds with this patch. -1 core tests . The patch failed these unit tests: org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-prefix-tree.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-client.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-protocol.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop1-compat.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-examples.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-thrift.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/7442//console This message is automatically generated.
        Hide
        James Kinley added a comment -

        needsBalance() uses an instance of ClusterLoadState to determine how many servers are active in the cluster. By default, "hbase.master.loadbalance.bytable" is false and therefore ClusterLoadState has a global view of the cluster and how many servers there are. If "hbase.master.loadbalance.bytable" was set to true then ClusterLoadState will only have a per table view of the cluster. In this case, if the logic was moved to needsBalance() then the balancer may or may not run for each table, it will definitely not run when the cluster has a single server, but needsBalance() will be called for each table. Is this what you would expect?

        Is there any reason why ClusterLoadState and ClusterStatus cannot be merged? At the moment, a new instance of both is created every time the balancer is run and ClusterStatus is only used by StochasticLoadBalancer. Wouldn't it be better to have a single ClusterStatus object that also contains load information, and to call balancer.needsBalance() from HMaster#balance() before balancer.balanceCluster()?

        The two other checks in HMaster#balance() could also be moved into balancer.needsBalance() - isRegionsInTransition() and areDeadServersInProgress().

        Show
        James Kinley added a comment - needsBalance() uses an instance of ClusterLoadState to determine how many servers are active in the cluster. By default, "hbase.master.loadbalance.bytable" is false and therefore ClusterLoadState has a global view of the cluster and how many servers there are. If "hbase.master.loadbalance.bytable" was set to true then ClusterLoadState will only have a per table view of the cluster. In this case, if the logic was moved to needsBalance() then the balancer may or may not run for each table, it will definitely not run when the cluster has a single server, but needsBalance() will be called for each table. Is this what you would expect? Is there any reason why ClusterLoadState and ClusterStatus cannot be merged? At the moment, a new instance of both is created every time the balancer is run and ClusterStatus is only used by StochasticLoadBalancer. Wouldn't it be better to have a single ClusterStatus object that also contains load information, and to call balancer.needsBalance() from HMaster#balance() before balancer.balanceCluster()? The two other checks in HMaster#balance() could also be moved into balancer.needsBalance() - isRegionsInTransition() and areDeadServersInProgress().
        Hide
        Elliott Clark added a comment -

        Shouldn't this logic be in BaseLoadBalancer#needsBalance

        Show
        Elliott Clark added a comment - Shouldn't this logic be in BaseLoadBalancer#needsBalance
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12605478/HBASE-8710-2.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 hadoop1.0. The patch compiles against the hadoop 1.0 profile.

        +1 hadoop2.0. The patch compiles against the hadoop 2.0 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 lineLengths. The patch does not introduce lines longer than 100

        +1 site. The mvn site goal succeeds with this patch.

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

        Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-prefix-tree.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-client.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-protocol.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop1-compat.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-examples.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-thrift.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html
        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//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/12605478/HBASE-8710-2.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 hadoop1.0 . The patch compiles against the hadoop 1.0 profile. +1 hadoop2.0 . The patch compiles against the hadoop 2.0 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 lineLengths . The patch does not introduce lines longer than 100 +1 site . The mvn site goal succeeds with this patch. +1 core tests . The patch passed unit tests in . Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-prefix-tree.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-client.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-protocol.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop1-compat.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-examples.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-thrift.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/7404//console This message is automatically generated.
        Hide
        Jean-Daniel Cryans added a comment -

        Patch didn't apply because it was doing unrelated cleaning of imports which were already taken care of (it's usually better to turn that feature off in your IDE). Attaching the same patch without those.

        Also disregard my nit, it's still early here

        Show
        Jean-Daniel Cryans added a comment - Patch didn't apply because it was doing unrelated cleaning of imports which were already taken care of (it's usually better to turn that feature off in your IDE). Attaching the same patch without those. Also disregard my nit, it's still early here
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12605463/HBASE-8710-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 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/7403//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/12605463/HBASE-8710-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 patch . The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/7403//console This message is automatically generated.
        Hide
        Jean-Daniel Cryans added a comment -

        Submitting patch to get a QA run.

        Also, minor nit, we usually put final in front of static and not the reverse.

        Show
        Jean-Daniel Cryans added a comment - Submitting patch to get a QA run. Also, minor nit, we usually put final in front of static and not the reverse.

          People

          • Assignee:
            James Kinley
            Reporter:
            Jean-Daniel Cryans
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development