Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 73D00102FC for ; Tue, 18 Aug 2015 15:59:10 +0000 (UTC) Received: (qmail 74624 invoked by uid 500); 18 Aug 2015 15:59:10 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 74588 invoked by uid 500); 18 Aug 2015 15:59:10 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 74579 invoked by uid 99); 18 Aug 2015 15:59:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Aug 2015 15:59:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 22ABEDFFED; Tue, 18 Aug 2015 15:59:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tedyu@apache.org To: commits@hbase.apache.org Message-Id: <051544f710b54c0db311e83a7e0f6a93@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-14234 Exception encountered in WALProcedureStore#rollWriter() should be properly handled Date: Tue, 18 Aug 2015 15:59:10 +0000 (UTC) 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 Authored: Tue Aug 18 08:58:59 2015 -0700 Committer: tedyu 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 {