hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nspiegelb...@apache.org
Subject svn commit: r1199071 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Date Tue, 08 Nov 2011 02:43:10 GMT
Author: nspiegelberg
Date: Tue Nov  8 02:43:10 2011
New Revision: 1199071

URL: http://svn.apache.org/viewvc?rev=1199071&view=rev
Log:
HBASE-2312 handle errors in splitLog correctly

Summary: There is also an open task - #772416 master may fail to replay logs -
that calls for better error handling.

Test Plan: minor change. not tested.

Reviewers: nspiegelberg, kannan

Reviewed By: nspiegelberg

CC: hbase-eng@lists, nspiegelberg, pkhemani

Differential Revision: 350043

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1199071&r1=1199070&r2=1199071&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Tue Nov
 8 02:43:10 2011
@@ -954,10 +954,14 @@ public class HMaster extends Thread impl
             + HConstants.HLOG_SPLITTING_EXT);
         try {
           if (!this.fs.rename(logDir, splitDir)) {
-            LOG.error("Failed fs.rename of " + logDir);
+            LOG.error("Failed log splitting because " +
+              " failed fs.rename of " + logDir);
+            return;
           }
         } catch (IOException ioe) {
-          LOG.error("Failed fs.rename of " + logDir, ioe);
+          LOG.error("Failed log splitting because" +
+            " failed fs.rename of " + logDir, ioe);
+          return;
         }
         logDir = splitDir;
         LOG.debug("Renamed region directory: " + splitDir);
@@ -972,7 +976,9 @@ public class HMaster extends Thread impl
         splitCount += contentSummary.getFileCount();
         splitLogSize += contentSummary.getSpaceConsumed();
       } catch (IOException e) {
-        LOG.error("Failed to get file system content summary", e);
+        LOG.error("Failed log splitting because" +
+          " failed to get file system content summary", e);
+        return;
       }
     }
     splitTime = EnvironmentEdgeManager.currentTimeMillis();
@@ -991,6 +997,7 @@ public class HMaster extends Thread impl
         }
       } catch (IOException e) {
         LOG.error("Failed distributed splitting " + serverNames, e);
+        return;
       }
     } else {
       // splitLogLock ensures that dead region servers' logs are processed
@@ -1002,6 +1009,7 @@ public class HMaster extends Thread impl
               getConfiguration());
         } catch (IOException e) {
           LOG.error("Failed splitting " + logDir.toString(), e);
+          return;
         } finally {
           this.splitLogLock.unlock();
         }



Mime
View raw message