You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2011/07/18 13:45:05 UTC

svn commit: r1147819 - /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java

Author: tedyu
Date: Mon Jul 18 11:45:05 2011
New Revision: 1147819

URL: http://svn.apache.org/viewvc?rev=1147819&view=rev
Log:
HBASE-4052 reapply code in unassign() which handles NotServingRegionException

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1147819&r1=1147818&r2=1147819&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java Mon Jul 18 11:45:05 2011
@@ -1449,23 +1449,26 @@ public class AssignmentManager extends Z
       // 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());