From 8ae3106b95550d0aad65a13d79e1025345d971ad Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Mon, 18 Jul 2011 11:45:05 +0000 Subject: [PATCH] HBASE-4052 reapply code in unassign() which handles NotServingRegionException git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1147819 13f79535-47bb-0310-9956-ffa450edef68 --- .../hbase/master/AssignmentManager.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java b/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java index f25ff6f716a..63f6322fcae 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java +++ b/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java @@ -1449,23 +1449,26 @@ public class AssignmentManager extends ZooKeeperListener { // Presume that master has stale data. Presume remote side just split. // Presume that the split message when it comes in will fix up the master's // in memory cluster state. - if (checkIfRegionBelongsToDisabling(region)) { - // Remove from the regionsinTransition map - LOG.info("While trying to recover the table:" - + region.getTableNameAsString() - + " from DISABLING state to DISABLED state, the region:" + region - + " was already offlined."); - synchronized (this.regionsInTransition) { - this.regionsInTransition.remove(region.getEncodedName()); - } - // Remove from the regionsMap - synchronized (this.regions) { - this.regions.remove(region); - } - } + return; } catch (Throwable t) { if (t instanceof RemoteException) { t = ((RemoteException)t).unwrapRemoteException(); + if (t instanceof NotServingRegionException) { + if (checkIfRegionBelongsToDisabling(region)) { + // Remove from the regionsinTransition map + LOG.info("While trying to recover the table " + + region.getTableNameAsString() + + " to DISABLED state the region " + region + + " was offlined but the table was in DISABLING state"); + synchronized (this.regionsInTransition) { + this.regionsInTransition.remove(region.getEncodedName()); + } + // Remove from the regionsMap + synchronized (this.regions) { + this.regions.remove(region); + } + } + } } LOG.info("Server " + server + " returned " + t + " for " + region.getEncodedName());