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 75B33CECF for ; Wed, 13 Jun 2012 02:41:48 +0000 (UTC) Received: (qmail 40295 invoked by uid 500); 13 Jun 2012 02:41:46 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 39786 invoked by uid 500); 13 Jun 2012 02:41:45 -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 39706 invoked by uid 99); 13 Jun 2012 02:41:44 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 02:41:44 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 3BCE414286B for ; Wed, 13 Jun 2012 02:41:44 +0000 (UTC) Date: Wed, 13 Jun 2012 02:41:44 +0000 (UTC) From: "Xing Shi (JIRA)" To: issues@hbase.apache.org Message-ID: <240946029.10466.1339555304246.JavaMail.jiratomcat@issues-vm> In-Reply-To: <554432256.1951.1339383644428.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (HBASE-6195) Increment data will be lost when the memstore is flushed 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-6195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294076#comment-13294076 ] Xing Shi commented on HBASE-6195: --------------------------------- @Ted + public void testParallelIncrementWithMemStoreFlush() throws Exception { + Configuration conf = HBaseConfiguration.create(); + String method = "testParallelismIncrementWithMemStoreFlush"; ////HERE we should also change the method to "testParallelIncrementWithMemStoreFlush"... + byte[] tableName = Bytes.toBytes(method); + ..... > Increment data will be lost when the memstore is flushed > -------------------------------------------------------- > > Key: HBASE-6195 > URL: https://issues.apache.org/jira/browse/HBASE-6195 > Project: HBase > Issue Type: Bug > Components: regionserver > Reporter: Xing Shi > Assignee: ShiXing > Attachments: 6195-trunk-V7.patch, HBASE-6195-trunk-V2.patch, HBASE-6195-trunk-V3.patch, HBASE-6195-trunk-V4.patch, HBASE-6195-trunk-V5.patch, HBASE-6195-trunk-V6.patch, HBASE-6195-trunk.patch > > > There are two problems in increment() now: > First: > I see that the timestamp(the variable now) in HRegion's Increment() is generated before got the rowLock, so when there are multi-thread increment the same row, although it generate earlier, it may got the lock later. Because increment just store one version, so till now, the result will still be right. > When the region is flushing, these increment will read the kv from snapshot and memstore with whose timestamp is larger, and write it back to memstore. If the snapshot's timestamp larger than the memstore, the increment will got the old data and then do the increment, it's wrong. > Secondly: > Also there is a risk in increment. Because it writes the memstore first and then HLog, so if it writes HLog failed, the client will also read the incremented value. -- 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