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 A2757200D5A for ; Thu, 14 Dec 2017 10:59:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A0D37160C04; Thu, 14 Dec 2017 09:59:04 +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 E620E160C01 for ; Thu, 14 Dec 2017 10:59:03 +0100 (CET) Received: (qmail 48243 invoked by uid 500); 14 Dec 2017 09:59:03 -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 48232 invoked by uid 99); 14 Dec 2017 09:59:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2017 09:59:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 83BF818096B for ; Thu, 14 Dec 2017 09:59:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id q7kmZ-dLW1_C for ; Thu, 14 Dec 2017 09:59:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 430815F367 for ; Thu, 14 Dec 2017 09:59:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id BEC84E0248 for ; Thu, 14 Dec 2017 09:59:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 78A34212FA for ; Thu, 14 Dec 2017 09:59:00 +0000 (UTC) Date: Thu, 14 Dec 2017 09:59:00 +0000 (UTC) From: "Anoop Sam John (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-19511) Splits causes blocks to be cached again and so such blocks cannot be evicted from bucket cache MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 14 Dec 2017 09:59:04 -0000 [ https://issues.apache.org/jira/browse/HBASE-19511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16290636#comment-16290636 ] Anoop Sam John commented on HBASE-19511: ---------------------------------------- +1 > Splits causes blocks to be cached again and so such blocks cannot be evicted from bucket cache > ---------------------------------------------------------------------------------------------- > > Key: HBASE-19511 > URL: https://issues.apache.org/jira/browse/HBASE-19511 > Project: HBase > Issue Type: Bug > Components: BucketCache > Affects Versions: 2.0.0-alpha-4 > Reporter: ramkrishna.s.vasudevan > Assignee: ramkrishna.s.vasudevan > Priority: Critical > Fix For: 3.0.0, 2.0.0-beta-1 > > Attachments: HBASE-19511.patch, HBASE-19511_1.patch > > > This is because of similar pattern as in > https://issues.apache.org/jira/browse/HBASE-8547. > It took a lot of time to debug this and the reason for TestBlockeEvictionFromClient was flaky due to this. > When we create split files the index of the firstKey that we create could possibly be the same key as in the case of #testBlockRefCountAfterSplits(). > In such cases we were getting the same block to be cached again in the bucket cache. As part of HBASE-8547 such cases were being handled. > {code} > String msg = "Caching an already cached block: " + cacheKey; > msg += ". This is harmless and can happen in rare cases (see HBASE-8547)"; > LOG.warn(msg); > {code} > But this is a tricky case where this log msg will be coming only when block with same cachekey was completely cached in the bucket cache. If there is a case where the block with the same cachekey was not yet completed written to bucket cache (by cache writer threads) this this log msg won't come but the ramCache key wil prevent the block from again getting cached. > {code} > if (ramCache.putIfAbsent(cacheKey, re) != null) { > return; > } > {code} > So when ever the block was getting cached once again and it is already in backingMap then we were doing a getBlock() to verify if the block is the same block. This was internallly adding to the refcount and so those blocks will never get removed from the bucket cache queue. ( there is no one to decrement the ref count on such cases). > So I think for this rare cases it is better we do a copy of the block and then check if the block is same as the existing one. This should be harmless and should help us in doing proper ref counting -- This message was sent by Atlassian JIRA (v6.4.14#64029)