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
This commit is contained in:
jxiang 2014-03-14 03:06:32 +00:00
parent 6b2437de2c
commit 575f58f13c
2 changed files with 9 additions and 15 deletions

View File

@ -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);
}

View File

@ -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