hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject git commit: HBASE-11328 testMoveRegion could fail
Date Wed, 11 Jun 2014 18:28:19 GMT
Repository: hbase
Updated Branches:
  refs/heads/master af9fa42e1 -> 9944c6031


HBASE-11328 testMoveRegion could fail


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

Branch: refs/heads/master
Commit: 9944c6031fc9f2f6dfbf2fed24c0c215425f6ffa
Parents: af9fa42
Author: Jimmy Xiang <jxiang@cloudera.com>
Authored: Wed Jun 11 09:09:17 2014 -0700
Committer: Jimmy Xiang <jxiang@cloudera.com>
Committed: Wed Jun 11 11:28:01 2014 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/HRegionServer.java |  5 ++---
 .../hadoop/hbase/regionserver/RSRpcServices.java |  2 +-
 .../master/TestAssignmentManagerOnCluster.java   | 19 ++++++++++++-------
 3 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9944c603/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index ba6a516..f251bb8 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -2627,9 +2627,8 @@ public class HRegionServer extends HasThread implements
       LOG.warn("Not adding moved region record: " + encodedName + " to self.");
       return;
     }
-    LOG.info("Adding moved region record: " + encodedName + " to "
-        + destination.getServerName() + ":" + destination.getPort()
-        + " as of " + closeSeqNum);
+    LOG.info("Adding moved region record: "
+      + encodedName + " to " + destination + " as of " + closeSeqNum);
     movedRegions.put(encodedName, new MovedRegionInfo(destination, closeSeqNum));
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/9944c603/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index 9d90d1d..ddf655f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -908,7 +908,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
       }
 
       requestCount.increment();
-      LOG.info("Close " + encodedRegionName + ", on " + sn);
+      LOG.info("Close " + encodedRegionName + ", moving to " + sn);
       CloseRegionCoordination.CloseRegionDetails crd = regionServer.getCoordinatedStateManager()
         .getCloseRegionCoordination().parseFromProtoRequest(request);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/9944c603/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
index a6cd57a..8e9053b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java
@@ -33,6 +33,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.CoordinatedStateManager;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
@@ -48,7 +49,6 @@ import org.apache.hadoop.hbase.Waiter;
 import org.apache.hadoop.hbase.catalog.MetaEditor;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
-import org.apache.hadoop.hbase.CoordinatedStateManager;
 import org.apache.hadoop.hbase.coprocessor.BaseRegionObserver;
 import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
 import org.apache.hadoop.hbase.coprocessor.ObserverContext;
@@ -62,6 +62,7 @@ import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
 import org.apache.hadoop.hbase.util.FSUtils;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
 import org.apache.hadoop.hbase.zookeeper.ZKAssign;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import org.apache.zookeeper.KeeperException;
@@ -243,14 +244,18 @@ public class TestAssignmentManagerOnCluster {
     try {
       HRegionInfo hri = createTableAndGetOneRegion(table);
 
-      RegionStates regionStates = TEST_UTIL.getHBaseCluster().
-        getMaster().getAssignmentManager().getRegionStates();
+      HMaster master = TEST_UTIL.getHBaseCluster().getMaster();
+      RegionStates regionStates = master.getAssignmentManager().getRegionStates();
       ServerName serverName = regionStates.getRegionServerOfRegion(hri);
+      ServerManager serverManager = master.getServerManager();
       ServerName destServerName = null;
-      for (int i = 0; i < 3; i++) {
-        HRegionServer destServer = TEST_UTIL.getHBaseCluster().getRegionServer(i);
-        if (!destServer.getServerName().equals(serverName)) {
-          destServerName = destServer.getServerName();
+      List<JVMClusterUtil.RegionServerThread> regionServers =
+        TEST_UTIL.getHBaseCluster().getLiveRegionServerThreads();
+      for (JVMClusterUtil.RegionServerThread regionServer: regionServers) {
+        HRegionServer destServer = regionServer.getRegionServer();
+        destServerName = destServer.getServerName();
+        if (!destServerName.equals(serverName)
+            && serverManager.isServerOnline(destServerName)) {
           break;
         }
       }


Mime
View raw message