Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 23C52200B6D for ; Tue, 23 Aug 2016 19:00:28 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2279B160ABF; Tue, 23 Aug 2016 17:00:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 70296160A81 for ; Tue, 23 Aug 2016 19:00:27 +0200 (CEST) Received: (qmail 35334 invoked by uid 500); 23 Aug 2016 17:00:26 -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 35315 invoked by uid 99); 23 Aug 2016 17:00:26 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2016 17:00:26 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 57E862C0152 for ; Tue, 23 Aug 2016 17:00:26 +0000 (UTC) Date: Tue, 23 Aug 2016 17:00:26 +0000 (UTC) From: "Anoop Sam John (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-16440) MemstoreChunkPool might cross its maxCount of chunks to pool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 23 Aug 2016 17:00:28 -0000 [ https://issues.apache.org/jira/browse/HBASE-16440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Anoop Sam John updated HBASE-16440: ----------------------------------- Resolution: Fixed Hadoop Flags: Reviewed Status: Resolved (was: Patch Available) Pushed to master. Thanks for the reviews Ram and Stack. > MemstoreChunkPool might cross its maxCount of chunks to pool > ------------------------------------------------------------ > > Key: HBASE-16440 > URL: https://issues.apache.org/jira/browse/HBASE-16440 > Project: HBase > Issue Type: Sub-task > Reporter: Anoop Sam John > Assignee: Anoop Sam John > Fix For: 2.0.0 > > Attachments: HBASE-16440.patch, HBASE-16440_V2.patch, HBASE-16440_V3.patch > > > {code} > void putbackChunks(BlockingQueue chunks) { > int maxNumToPutback = this.maxCount - reclaimedChunks.size(); > if (maxNumToPutback <= 0) { > return; > } > chunks.drainTo(reclaimedChunks, maxNumToPutback); > // clear reference of any non-reclaimable chunks > if (chunks.size() > 0) { > if (LOG.isTraceEnabled()) { > LOG.trace("Left " + chunks.size() + " unreclaimable chunks, removing them from queue"); > } > chunks.clear(); > } > } > {code} > There is no synchroization. 2 threads might be calling this API as part of a MSLAB close. (Once the memstore is flushed). It pass all the chunks used by it. (Those might not have been come from pool also). We try to put back chunks such that it is not crossing maxCount. Suppose maxCount is 10 and currently no chunks in 'reclaimedChunks'. Say both threads at line one. Both see 'maxNumToPutback ' as 10 and that will make 20 chunks being pooled. Similar issue is in putbackChunk(Chunk chunk) API also. -- This message was sent by Atlassian JIRA (v6.3.4#6332)