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 781FF10D9C for ; Sat, 16 Nov 2013 19:09:24 +0000 (UTC) Received: (qmail 19124 invoked by uid 500); 16 Nov 2013 19:09:24 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 19096 invoked by uid 500); 16 Nov 2013 19:09:24 -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 19087 invoked by uid 99); 16 Nov 2013 19:09:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Nov 2013 19:09:24 +0000 Date: Sat, 16 Nov 2013 19:09:24 +0000 (UTC) From: "Hudson (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-9963) Remove the ReentrantReadWriteLock in the MemStore 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-9963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13824582#comment-13824582 ] Hudson commented on HBASE-9963: ------------------------------- SUCCESS: Integrated in HBase-0.94-security #337 (See [https://builds.apache.org/job/HBase-0.94-security/337/]) HBASE-9963 Fix TestHeapSize (larsh: rev 1542358) * /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java > Remove the ReentrantReadWriteLock in the MemStore > ------------------------------------------------- > > Key: HBASE-9963 > URL: https://issues.apache.org/jira/browse/HBASE-9963 > Project: HBase > Issue Type: Improvement > Components: regionserver > Affects Versions: 0.98.0, 0.96.0 > Reporter: Nicolas Liochon > Assignee: Nicolas Liochon > Priority: Minor > Fix For: 0.98.0, 0.96.1, 0.94.14 > > Attachments: 9963.96.v3.patch, 9963.v1.patch, 9963.v2.patch, 9963.v3.patch > > > If I'm not wrong, the MemStore is always used from the HStore. The code in HStore puts a lock before calling MemStore. So the lock in Memstore is useless. > For example, in HStore > {code} > @Override > public long upsert(Iterable cells, long readpoint) throws IOException { > this.lock.readLock().lock(); > try { > return this.memstore.upsert(cells, readpoint); > } finally { > this.lock.readLock().unlock(); > } > } > {code} > With this in MemStore > {code} > public long upsert(Iterable cells, long readpoint) { > this.lock.readLock().lock(); // <==========Am I useful? > try { > long size = 0; > for (Cell cell : cells) { > size += upsert(cell, readpoint); > } > return size; > } finally { > this.lock.readLock().unlock(); > } > } > {code} > I've checked, all the locks in MemStore are backed by a lock in HStore, the only exception beeing > {code} > void snapshot() { > this.memstore.snapshot(); > } > {code} > And I would say it's a bug. If it's confirm ([~lhofhansl], what do you think?), I will add a lock there and remove all of them in MemStore. They do appear in the profiling. -- This message was sent by Atlassian JIRA (v6.1#6144)