hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1164803 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Date Sat, 03 Sep 2011 05:06:49 GMT
Author: tedyu
Date: Sat Sep  3 05:06:49 2011
New Revision: 1164803

URL: http://svn.apache.org/viewvc?rev=1164803&view=rev
Log:
HBASE-4265  zookeeper.KeeperException$NodeExistsException if HMaster restarts
               while table is being disabled (Ming Ma)

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

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1164803&r1=1164802&r2=1164803&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Sat Sep  3 05:06:49 2011
@@ -237,6 +237,8 @@ Release 0.91.0 - Unreleased
                HMaster restarts (Ming Ma)
    HBASE-4310  SlabCache metrics bugfix (Li Pi)
    HBASE-4027  Off Heap Cache never creates Slabs (Li Pi)
+   HBASE-4265  zookeeper.KeeperException$NodeExistsException if HMaster restarts
+               while table is being disabled (Ming Ma)
 
   IMPROVEMENTS
    HBASE-3290  Max Compaction Size (Nicolas Spiegelberg via Stack)  

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=1164803&r1=1164802&r2=1164803&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 Sat Sep
 3 05:06:49 2011
@@ -132,6 +132,11 @@ public class AssignmentManager extends Z
 
   private final ZKTable zkTable;
 
+  // store all the table names in disabling state
+  Set<String> disablingTables = new HashSet<String>(1);
+  // store all the enabling state tablenames.
+  Set<String> enablingTables = new HashSet<String>(1);
+
   /**
    * Server to regions assignment map.
    * Contains the set of regions currently assigned to a given server.
@@ -307,6 +312,11 @@ public class AssignmentManager extends Z
     processDeadServers(deadServers);
     // Check existing regions in transition
     processRegionsInTransition(deadServers);
+
+    // Recover the tables that were not fully moved to DISABLED state.
+    // These tables are in DISABLING state when the master restarted/switched.
+    boolean isWatcherCreated = recoverTableInDisablingState(this.disablingTables);
+    recoverTableInEnablingState(this.enablingTables, isWatcherCreated);
   }
 
   /**
@@ -1929,10 +1939,6 @@ public class AssignmentManager extends Z
     // Map of offline servers and their regions to be returned
     Map<ServerName, List<Pair<HRegionInfo,Result>>> offlineServers =
       new TreeMap<ServerName, List<Pair<HRegionInfo, Result>>>();
-    // store all the table names in disabling state
-    Set<String> disablingTables = new HashSet<String>(1);
-    // store all the enabling state tablenames.
-    Set<String> enablingTables = new HashSet<String>(1);
     // Iterate regions in META
     for (Result result : results) {
       Pair<HRegionInfo, ServerName> region = MetaReader.metaRowToRegionPair(result);
@@ -1956,7 +1962,7 @@ public class AssignmentManager extends Z
             " has null regionLocation." + " But its table " + tableName +
             " isn't in ENABLING state.");
         }
-        addTheTablesInPartialState(disablingTables, enablingTables, regionInfo,
+        addTheTablesInPartialState(this.disablingTables, this.enablingTables, regionInfo,
             tableName);
       } else if (!this.serverManager.isServerOnline(regionLocation)) {
         // Region is located on a server that isn't online
@@ -1975,17 +1981,13 @@ public class AssignmentManager extends Z
           regions.put(regionInfo, regionLocation);
           addToServers(regionLocation, regionInfo);
         }
-        addTheTablesInPartialState(disablingTables, enablingTables, regionInfo,
+        addTheTablesInPartialState(this.disablingTables, this.enablingTables, regionInfo,
             tableName);
       }
     }
-    // Recover the tables that were not fully moved to DISABLED state.
-    // These tables are in DISABLING state when the master restarted/switched.
-    boolean isWatcherCreated = recoverTableInDisablingState(disablingTables);
-    recoverTableInEnablingState(enablingTables, isWatcherCreated);
     return offlineServers;
   }
-  
+
   private void addTheTablesInPartialState(Set<String> disablingTables,
       Set<String> enablingTables, HRegionInfo regionInfo,
       String disablingTableName) {



Mime
View raw message