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:05:29 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 34dfd6c9b -> 90b51e85c


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/90b51e85
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/90b51e85
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/90b51e85

Branch: refs/heads/master
Commit: 90b51e85c4506089f39e6fe3bb27f338492bade6
Parents: 34dfd6c
Author: stack <stack@apache.org>
Authored: Thu Jul 2 10:05:04 2015 -0700
Committer: stack <stack@apache.org>
Committed: Thu Jul 2 10:05:18 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/90b51e85/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 8426689..71be7c7 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
@@ -944,7 +944,7 @@ public class AssignmentManager {
       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/90b51e85/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 6842235..4c4697d 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
@@ -96,7 +96,6 @@ public class TestRegionRebalancing {
    * @throws InterruptedException
    */
   @Test (timeout=300000)
-  @SuppressWarnings("deprecation")
   public void testRebalanceOnRegionServerNumberChange()
   throws IOException, InterruptedException {
     try(Connection connection = ConnectionFactory.createConnection(UTIL.getConfiguration());
@@ -133,6 +132,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();
   
@@ -141,9 +141,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();
@@ -155,6 +155,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