You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by la...@apache.org on 2012/08/31 05:53:49 UTC

svn commit: r1379277 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java

Author: larsh
Date: Fri Aug 31 03:53:49 2012
New Revision: 1379277

URL: http://svn.apache.org/viewvc?rev=1379277&view=rev
Log:
HBASE-6537 Race between balancer and disable table can lead to inconsistent cluster (Zhou wenjian)

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

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1379277&r1=1379276&r2=1379277&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java Fri Aug 31 03:53:49 2012
@@ -1257,14 +1257,15 @@ public class AssignmentManager extends Z
    * @param regionInfo
    */
   public void regionOffline(final HRegionInfo regionInfo) {
+    // remove the region plan as well just in case.
+    clearRegionPlan(regionInfo);
+    setOffline(regionInfo);
+
     synchronized(this.regionsInTransition) {
       if (this.regionsInTransition.remove(regionInfo.getEncodedName()) != null) {
         this.regionsInTransition.notifyAll();
       }
     }
-    // remove the region plan as well just in case.
-    clearRegionPlan(regionInfo);
-    setOffline(regionInfo);
   }
 
   /**
@@ -2065,7 +2066,8 @@ public class AssignmentManager extends Z
       if (t instanceof RemoteException) {
         t = ((RemoteException)t).unwrapRemoteException();
         if (t instanceof NotServingRegionException) {
-          if (checkIfRegionBelongsToDisabling(region)) {
+          if (checkIfRegionBelongsToDisabling(region)
+              || checkIfRegionBelongsToDisabled(region)) {
             // Remove from the regionsinTransition map
             LOG.info("While trying to recover the table "
                 + region.getTableNameAsString()