hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r893381 - in /hadoop/hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java src/java/org/apache/hadoop/hbase/master/RegionManager.java
Date Wed, 23 Dec 2009 02:39:09 GMT
Author: jdcryans
Date: Wed Dec 23 02:39:09 2009
New Revision: 893381

URL: http://svn.apache.org/viewvc?rev=893381&view=rev
Log:
HBASE-2064  Cannot disable a table if at the same the Master is moving   
            its regions around
HBASE-2065  Cannot disable a table if any of its region is opening   
            at the same time

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=893381&r1=893380&r2=893381&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Wed Dec 23 02:39:09 2009
@@ -24,6 +24,10 @@
                hbase.version
    HBASE-2054  memstore size 0 is >= than blocking -2.0g size
    HBASE-2057  Cluster won't stop 
+   HBASE-2064  Cannot disable a table if at the same the Master is moving 
+               its regions around
+   HBASE-2065  Cannot disable a table if any of its region is opening 
+               at the same time
 
   IMPROVEMENTS
    HBASE-1961  HBase EC2 scripts

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java?rev=893381&r1=893380&r2=893381&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
Wed Dec 23 02:39:09 2009
@@ -103,8 +103,16 @@
           master.regionManager.metaScannerThread.interrupt();
         }
       }
-      // If updated successfully, remove from pending list.
-      master.regionManager.removeRegion(regionInfo);
+      // If updated successfully, remove from pending list if the state
+      // is consistent. For example, a disable could be called before the
+      // synchronization.
+      if(master.regionManager.
+        isOfflined(regionInfo.getRegionNameAsString())) {
+        LOG.warn("We opened a region while it was asked to be closed.");
+      } else {
+        master.regionManager.removeRegion(regionInfo);
+      }
+
       return true;
     }
   }

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=893381&r1=893380&r2=893381&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
Wed Dec 23 02:39:09 2009
@@ -957,7 +957,7 @@
         s = new RegionState(info);
         regionsInTransition.put(info.getRegionNameAsString(), s);
       }
-      if (force || (!s.isPendingOpen() && !s.isOpen())) {
+      if (force || (!s.isPendingOpen() || !s.isOpen())) {
         s.setUnassigned();
       }
     }
@@ -1030,7 +1030,7 @@
    * @param regionInfo
    * @param setOffline
    */
-  public void setClosing(final String serverName, final HRegionInfo regionInfo,
+  public void setClosing(String serverName, final HRegionInfo regionInfo,
       final boolean setOffline) {
     synchronized (this.regionsInTransition) {
       RegionState s =
@@ -1038,6 +1038,12 @@
       if (s == null) {
         s = new RegionState(regionInfo);
       }
+      // If region was asked to open before getting here, we could be taking
+      // the wrong server name
+      if(s.isPendingOpen()) {
+        serverName = s.getServerName();
+      }
+
       s.setClosing(serverName, setOffline);
       this.regionsInTransition.put(regionInfo.getRegionNameAsString(), s);
     }
@@ -1640,10 +1646,10 @@
     }
     
     synchronized void setClosed() {
-      if (!pendingClose && !pendingOpen) {
+      if (!pendingClose && !pendingOpen && !closing) {
         throw new IllegalStateException(
             "Cannot set a region to be closed if it was not already marked as" +
-            " pending close or pending open. State: " + toString());
+            " pending close, pending open or closing. State: " + toString());
       }
       this.unassigned = false;
       this.pendingOpen = false;



Mime
View raw message