hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-14010 TestRegionRebalancing.testRebalanceOnRegionServerNumberChange fails; cluster not balanced
Date Thu, 02 Jul 2015 17:07:18 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 480fd9e05 -> 913d0c726


HBASE-14010 TestRegionRebalancing.testRebalanceOnRegionServerNumberChange fails; cluster not
balanced


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/913d0c72
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/913d0c72
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/913d0c72

Branch: refs/heads/branch-1.2
Commit: 913d0c726ad7b2f099c336b3657184085f840053
Parents: 480fd9e
Author: stack <stack@apache.org>
Authored: Thu Jul 2 10:05:04 2015 -0700
Committer: stack <stack@apache.org>
Committed: Thu Jul 2 10:06:53 2015 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/master/AssignmentManager.java |  2 +-
 .../apache/hadoop/hbase/TestRegionRebalancing.java    | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/913d0c72/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
index 3cf6273..6dd5997 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
@@ -1948,7 +1948,7 @@ public class AssignmentManager extends ZooKeeperListener {
       final HRegionInfo region, final boolean forceNewPlan) {
     RegionState state = regionStates.getRegionState(region);
     if (state == null) {
-      LOG.warn("Assigning a region not in region states: " + region);
+      LOG.warn("Assigning but not in region states: " + region);
       state = regionStates.createRegionState(region);
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/913d0c72/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java
index 3af3c70..bd9d7d7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java
@@ -95,7 +95,6 @@ public class TestRegionRebalancing {
    * @throws InterruptedException
    */
   @Test (timeout=300000)
-  @SuppressWarnings("deprecation")
   public void testRebalanceOnRegionServerNumberChange()
   throws IOException, InterruptedException {
     try(Connection connection = ConnectionFactory.createConnection(UTIL.getConfiguration());
@@ -132,6 +131,7 @@ public class TestRegionRebalancing {
       // kill a region server - total of 2
       LOG.info("Stopped third server=" + UTIL.getHBaseCluster().stopRegionServer(2, false));
       UTIL.getHBaseCluster().waitOnRegionServer(2);
+      waitOnCrashProcessing();
       UTIL.getHBaseCluster().getMaster().balance();
       assertRegionsAreBalanced();
   
@@ -140,9 +140,9 @@ public class TestRegionRebalancing {
           UTIL.getHBaseCluster().startRegionServer().getRegionServer().getServerName());
       LOG.info("Added fourth server=" +
           UTIL.getHBaseCluster().startRegionServer().getRegionServer().getServerName());
+      waitOnCrashProcessing();
       assert(UTIL.getHBaseCluster().getMaster().balance() == true);
       assertRegionsAreBalanced();
-  
       for (int i = 0; i < 6; i++){
         LOG.info("Adding " + (i + 5) + "th region server");
         UTIL.getHBaseCluster().startRegionServer();
@@ -154,6 +154,16 @@ public class TestRegionRebalancing {
   }
 
   /**
+   * Wait on crash processing. Balancer won't run if processing a crashed server.
+   */
+  private void waitOnCrashProcessing() {
+    while (UTIL.getHBaseCluster().getMaster().getServerManager().areDeadServersInProgress())
{
+      LOG.info("Waiting on processing of crashed server before proceeding...");
+      Threads.sleep(1000);
+    }
+  }
+
+  /**
    * Determine if regions are balanced. Figure out the total, divide by the
    * number of online servers, then test if each server is +/- 1 of average
    * rounded up.


Mime
View raw message