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 A3EC49CA3 for ; Fri, 1 Jun 2012 05:43:29 +0000 (UTC) Received: (qmail 66237 invoked by uid 500); 1 Jun 2012 05:43:28 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 66099 invoked by uid 500); 1 Jun 2012 05:43:28 -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 65258 invoked by uid 99); 1 Jun 2012 05:43:27 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2012 05:43:27 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 81F10140C2C for ; Fri, 1 Jun 2012 05:43:27 +0000 (UTC) Date: Fri, 1 Jun 2012 05:43:27 +0000 (UTC) From: "Hudson (JIRA)" To: issues@hbase.apache.org Message-ID: <561313435.25356.1338529407534.JavaMail.jiratomcat@issues-vm> In-Reply-To: <2072292234.6350.1337657501206.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (HBASE-6065) Log for flush would append a non-sequential edit in the hlog, leading to possible data loss 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-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13287170#comment-13287170 ] Hudson commented on HBASE-6065: ------------------------------- Integrated in HBase-0.94-security #33 (See [https://builds.apache.org/job/HBase-0.94-security/33/]) HBASE-6118 Add a testcase for HBASE-6065 (Ashutosh) (Revision 1343336) Result = FAILURE ramkrishna : Files : * /hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java > Log for flush would append a non-sequential edit in the hlog, leading to possible data loss > ------------------------------------------------------------------------------------------- > > Key: HBASE-6065 > URL: https://issues.apache.org/jira/browse/HBASE-6065 > Project: HBase > Issue Type: Bug > Components: wal > Reporter: chunhui shen > Assignee: chunhui shen > Priority: Critical > Fix For: 0.96.0, 0.94.1 > > Attachments: HBASE-6065.patch, HBASE-6065v2.patch > > > After completing flush region, we will append a log edit in the hlog file through HLog#completeCacheFlush. > {code} > public void completeCacheFlush(final byte [] encodedRegionName, > final byte [] tableName, final long logSeqId, final boolean isMetaRegion) > { > ... > HLogKey key = makeKey(encodedRegionName, tableName, logSeqId, > System.currentTimeMillis(), HConstants.DEFAULT_CLUSTER_ID); > ... > } > {code} > when we make the hlog key, we use the seqId from the parameter, and it is generated by HLog#startCacheFlush, > Here, we may append a lower seq id edit than the last edit in the hlog file. > If it is the last edit log in the file, it may cause data loss. > because > {code} > HRegion#replayRecoveredEditsIfAny{ > ... > maxSeqId = Math.abs(Long.parseLong(fileName)); > if (maxSeqId <= minSeqId) { > String msg = "Maximum sequenceid for this log is " + maxSeqId > + " and minimum sequenceid for the region is " + minSeqId > + ", skipped the whole file, path=" + edits; > LOG.debug(msg); > continue; > } > ... > } > {code} > We may skip the splitted log file, because we use the lase edit's seq id as its file name, and consider this seqId as the max seq id in this log file. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira