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 2013/04/05 22:39:52 UTC

svn commit: r1465120 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java

Author: tedyu
Date: Fri Apr  5 20:39:52 2013
New Revision: 1465120

URL: http://svn.apache.org/r1465120
Log:
HBASE-8270 Backport HBASE-8097 'MetaServerShutdownHandler may potentially keep bumping up DeadServer.numProcessing' to 0.94 (Jeffrey Zhong)


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

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java?rev=1465120&r1=1465119&r2=1465120&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java Fri Apr  5 20:39:52 2013
@@ -50,53 +50,64 @@ public class MetaServerShutdownHandler e
 
   @Override
   public void process() throws IOException {
+
+    boolean gotException = true;
     try {
-      if (this.shouldSplitHlog) {
-        if (this.services.shouldSplitMetaSeparately()) {
-          LOG.info("Splitting META logs for " + serverName);
-          this.services.getMasterFileSystem().splitMetaLog(serverName);
+      try {
+        if (this.shouldSplitHlog) {
+          if (this.services.shouldSplitMetaSeparately()) {
+            LOG.info("Splitting META logs for " + serverName);
+            this.services.getMasterFileSystem().splitMetaLog(serverName);
+          } else {
+            LOG.info("Splitting all logs for " + serverName);
+            this.services.getMasterFileSystem().splitAllLogs(serverName);
+          }
+        }
+      } catch (IOException ioe) {
+        this.services.getExecutorService().submit(this);
+        this.deadServers.add(serverName);
+        throw new IOException("failed log splitting for " +
+            serverName + ", will retry", ioe);
+      }
+  
+      // Assign root and meta if we were carrying them.
+      if (isCarryingRoot()) { // -ROOT-
+        // Check again: region may be assigned to other where because of RIT
+        // timeout
+        if (this.services.getAssignmentManager().isCarryingRoot(serverName)) {
+          LOG.info("Server " + serverName
+              + " was carrying ROOT. Trying to assign.");
+          this.services.getAssignmentManager().regionOffline(
+              HRegionInfo.ROOT_REGIONINFO);
+          verifyAndAssignRootWithRetries();
         } else {
-          LOG.info("Splitting all logs for " + serverName);
-          this.services.getMasterFileSystem().splitAllLogs(serverName);
+          LOG.info("ROOT has been assigned to otherwhere, skip assigning.");
         }
       }
-    } catch (IOException ioe) {
-      this.services.getExecutorService().submit(this);
-      this.deadServers.add(serverName);
-      throw new IOException("failed log splitting for " +
-          serverName + ", will retry", ioe);
-    }
-
-    // Assign root and meta if we were carrying them.
-    if (isCarryingRoot()) { // -ROOT-
-      // Check again: region may be assigned to other where because of RIT
-      // timeout
-      if (this.services.getAssignmentManager().isCarryingRoot(serverName)) {
-        LOG.info("Server " + serverName
-            + " was carrying ROOT. Trying to assign.");
-        this.services.getAssignmentManager().regionOffline(
-            HRegionInfo.ROOT_REGIONINFO);
-        verifyAndAssignRootWithRetries();
-      } else {
-        LOG.info("ROOT has been assigned to otherwhere, skip assigning.");
+  
+      // Carrying meta?
+      if (isCarryingMeta()) {
+        // Check again: region may be assigned to other where because of RIT
+        // timeout
+        if (this.services.getAssignmentManager().isCarryingMeta(serverName)) {
+          LOG.info("Server " + serverName
+              + " was carrying META. Trying to assign.");
+          this.services.getAssignmentManager().regionOffline(
+              HRegionInfo.FIRST_META_REGIONINFO);
+          this.services.getAssignmentManager().assignMeta();
+        } else {
+          LOG.info("META has been assigned to otherwhere, skip assigning.");
+        }
       }
-    }
-
-    // Carrying meta?
-    if (isCarryingMeta()) {
-      // Check again: region may be assigned to other where because of RIT
-      // timeout
-      if (this.services.getAssignmentManager().isCarryingMeta(serverName)) {
-        LOG.info("Server " + serverName
-            + " was carrying META. Trying to assign.");
-        this.services.getAssignmentManager().regionOffline(
-            HRegionInfo.FIRST_META_REGIONINFO);
-        this.services.getAssignmentManager().assignMeta();
-      } else {
-        LOG.info("META has been assigned to otherwhere, skip assigning.");
+      
+      gotException = false;
+    } finally {
+      if (gotException){
+        // If we had an exception, this.deadServers.finish will be skipped in super.process()
+        this.deadServers.finish(serverName);
       }
-
     }
+
     super.process();
   }
   /**