hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-14234 Exception encountered in WALProcedureStore#rollWriter() should be properly handled
Date Tue, 18 Aug 2015 15:59:10 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 395ec5a9b -> 71d3d24d8


HBASE-14234 Exception encountered in WALProcedureStore#rollWriter() should be properly handled


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/71d3d24d
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/71d3d24d
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/71d3d24d

Branch: refs/heads/master
Commit: 71d3d24d8b5892121ac9c81606f3c71392a43e0b
Parents: 395ec5a
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Aug 18 08:58:59 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Aug 18 08:58:59 2015 -0700

----------------------------------------------------------------------
 .../procedure2/store/wal/WALProcedureStore.java     | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/71d3d24d/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
index 04715de..8764ff0 100644
--- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
+++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
@@ -53,6 +53,7 @@ import org.apache.hadoop.hbase.procedure2.util.ByteSlot;
 import org.apache.hadoop.hbase.procedure2.util.StringUtils;
 import org.apache.hadoop.hbase.protobuf.generated.ProcedureProtos.ProcedureWALHeader;
 import org.apache.hadoop.hbase.util.Threads;
+import org.apache.hadoop.ipc.RemoteException;
 
 import com.google.common.annotations.VisibleForTesting;
 
@@ -681,14 +682,23 @@ public class WALProcedureStore extends ProcedureStoreBase {
     FSDataOutputStream newStream = null;
     Path newLogFile = null;
     long startPos = -1;
+    newLogFile = getLogFilePath(logId);
     try {
-      newLogFile = getLogFilePath(logId);
       newStream = fs.create(newLogFile, false);
-      ProcedureWALFormat.writeHeader(newStream, header);
-      startPos = newStream.getPos();
     } catch (FileAlreadyExistsException e) {
       LOG.error("Log file with id=" + logId + " already exists", e);
       return false;
+    } catch (RemoteException re) {
+      LOG.warn("failed to create log file with id=" + logId, re);
+      return false;
+    }
+    try {
+      ProcedureWALFormat.writeHeader(newStream, header);
+      startPos = newStream.getPos();
+    } catch (IOException ioe) {
+      LOG.warn("Encountered exception writing header", ioe);
+      newStream.close();
+      return false;
     }
     lock.lock();
     try {


Mime
View raw message