From 575f58f13c80cc01b42dfc9a8155665f07e83fe6 Mon Sep 17 00:00:00 2001 From: jxiang Date: Fri, 14 Mar 2014 03:06:32 +0000 Subject: [PATCH] HBASE-10744 AM#CloseRegion no need to retry on FailedServerException git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1577416 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop/hbase/master/AssignmentManager.java | 7 +++++-- .../master/TestAssignmentManagerOnCluster.java | 17 ++++------------- 2 files changed, 9 insertions(+), 15 deletions(-) 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 ceccfff898e..f7208b68138 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 @@ -62,6 +62,7 @@ import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.executor.EventHandler; import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.executor.ExecutorService; +import org.apache.hadoop.hbase.ipc.RpcClient.FailedServerException; import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException; import org.apache.hadoop.hbase.master.RegionState.State; import org.apache.hadoop.hbase.master.balancer.FavoredNodeAssignmentHelper; @@ -1697,7 +1698,9 @@ public class AssignmentManager extends ZooKeeperListener { t = ((RemoteException)t).unwrapRemoteException(); } if (t instanceof NotServingRegionException - || t instanceof RegionServerStoppedException) { + || t instanceof RegionServerStoppedException + || t instanceof ServerNotRunningYetException + || t instanceof FailedServerException) { LOG.debug("Offline " + region.getRegionNameAsString() + ", it's not any more on " + server, t); if (transitionInZK) { @@ -2121,7 +2124,7 @@ public class AssignmentManager extends ZooKeeperListener { * if no servers to assign, it returns null). */ private RegionPlan getRegionPlan(final HRegionInfo region, - final boolean forceNewPlan) throws HBaseIOException { + final boolean forceNewPlan) throws HBaseIOException { return getRegionPlan(region, null, forceNewPlan); } 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 6f78a469334..0611ed57be0 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 @@ -750,23 +750,14 @@ public class TestAssignmentManagerOnCluster { // You can't assign a dead region before SSH am.assign(hri, true, true); RegionState state = regionStates.getRegionState(hri); - assertTrue(state.isFailedClose()); + assertTrue(state.isOffline()); // You can't unassign a dead region before SSH either am.unassign(hri, true); - state = regionStates.getRegionState(hri); - assertTrue(state.isFailedClose()); + assertTrue(state.isOffline()); - synchronized (regionStates) { - // Enable SSH so that log can be split - master.enableSSH(true); - - // We hold regionStates now, so logSplit - // won't be known to AM yet. - am.unassign(hri, true); - state = regionStates.getRegionState(hri); - assertTrue(state.isOffline()); - } + // Enable SSH so that log can be split + master.enableSSH(true); // let's check if it's assigned after it's out of transition. // no need to assign it manually, SSH should do it