Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8319E1850A for ; Thu, 11 Feb 2016 15:22:20 +0000 (UTC) Received: (qmail 88943 invoked by uid 500); 11 Feb 2016 15:22:18 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 88872 invoked by uid 500); 11 Feb 2016 15:22:18 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 88563 invoked by uid 99); 11 Feb 2016 15:22:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2016 15:22:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6688D2C1F5B for ; Thu, 11 Feb 2016 15:22:18 +0000 (UTC) Date: Thu, 11 Feb 2016 15:22:18 +0000 (UTC) From: "Ted Yu (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (HBASE-15252) Data loss when replaying wal if HDFS timeout MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-15252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15142856#comment-15142856 ] Ted Yu edited comment on HBASE-15252 at 2/11/16 3:22 PM: --------------------------------------------------------- Edit: The following test failure can be reproduced locally with path: {code} Tests run: 10, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 45.211 sec <<< FAILURE! - in org.apache.hadoop.hbase.regionserver.wal.TestSecureWALReplay testDatalossWhenInputError(org.apache.hadoop.hbase.regionserver.wal.TestSecureWALReplay) Time elapsed: 0.352 sec <<< ERROR! java.io.IOException: Got unknown writer class: SecureProtobufLogWriter at org.apache.hadoop.hbase.regionserver.wal.ProtobufLogReader.initInternal(ProtobufLogReader.java:205) at org.apache.hadoop.hbase.regionserver.wal.ProtobufLogReader.initReader(ProtobufLogReader.java:154) at org.apache.hadoop.hbase.regionserver.wal.ReaderBase.init(ReaderBase.java:66) at org.apache.hadoop.hbase.regionserver.wal.ProtobufLogReader.init(ProtobufLogReader.java:149) at org.apache.hadoop.hbase.regionserver.wal.TestWALReplay.testDatalossWhenInputError(TestWALReplay.java:978) {code} was (Author: yuzhihong@gmail.com): +1 > Data loss when replaying wal if HDFS timeout > -------------------------------------------- > > Key: HBASE-15252 > URL: https://issues.apache.org/jira/browse/HBASE-15252 > Project: HBase > Issue Type: Bug > Components: wal > Affects Versions: 2.0.0, 1.2.0, 1.3.0, 1.0.3, 1.1.3, 0.98.17 > Reporter: Duo Zhang > Assignee: Duo Zhang > Fix For: 2.0.0, 1.3.0, 1.2.1, 1.1.4, 1.0.4, 0.98.18 > > Attachments: HBASE-15252-testcase.patch, HBASE-15252.patch > > > This is a problem introduced by HBASE-13825 where we change the exception type in catch block in {{readNext}} method of {{ProtobufLogReader}}. > {code:title=ProtobufLogReader.java} > try { > ...... > ProtobufUtil.mergeFrom(builder, new LimitInputStream(this.inputStream, size), > (int)size); > } catch (IOException ipbe) { // <------ used to be InvalidProtocolBufferException > throw (EOFException) new EOFException("Invalid PB, EOF? Ignoring; originalPosition=" + > originalPosition + ", currentPosition=" + this.inputStream.getPos() + > ", messageSize=" + size + ", currentAvailable=" + available).initCause(ipbe); > } > {code} > Here if the {{inputStream}} throws an {{IOException}} due to timeout or something, we just convert it to an {{EOFException}} and at the bottom of this method, we ignore {{EOFException}} and return false. This cause the upper layer think we reach the end of file. So when replaying we will treat the HDFS timeout error as a normal end of file and cause data loss. -- This message was sent by Atlassian JIRA (v6.3.4#6332)