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 1A8C71055E for ; Tue, 27 Jan 2015 18:55:36 +0000 (UTC) Received: (qmail 5608 invoked by uid 500); 27 Jan 2015 18:55:36 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 5571 invoked by uid 500); 27 Jan 2015 18:55:36 -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 5410 invoked by uid 99); 27 Jan 2015 18:55:36 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jan 2015 18:55:36 +0000 Date: Tue, 27 Jan 2015 18:55:36 +0000 (UTC) From: "Lars Hofhansl (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-12931) The existing KeyValues in memstroe are not removed completely after inserting cell into 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-12931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14293967#comment-14293967 ] Lars Hofhansl commented on HBASE-12931: --------------------------------------- I think it is the correct the way it is. We can remove all KVs *after* we have proven that the oldest scanner has seen at least one version. I.e. that scanner has to be able to see one version (versionsVisible == 1) and the following KVs can be removed (versionVisible > 1). > The existing KeyValues in memstroe are not removed completely after inserting cell into memStore > ------------------------------------------------------------------------------------------------- > > Key: HBASE-12931 > URL: https://issues.apache.org/jira/browse/HBASE-12931 > Project: HBase > Issue Type: Bug > Reporter: ChiaPing Tsai > Priority: Minor > Fix For: 0.98.0 > > > If I'm not wrong, the UPSERT method of memStore should remove all existing KeyValues except the newer version. > In memStore, > {code:title=DefaultMemStore.java|borderStyle=solid} > int versIionsVisible = 0; > ... > if (cur.getTypeByte() == KeyValue.Type.Put.getCode() && > cur.getSequenceId() <= readpoint) { > if (versionsVisible > 1) { > // if we get here we have seen at least one version visible to the oldest scanner, > // which means we can prove that no scanner will see this version > // false means there was a change, so give us the size. > long delta = heapSizeChange(cur, true); > addedSize -= delta; > this.size.addAndGet(-delta); > it.remove(); > setOldestEditTimeToNow(); > } else { > versionsVisible++; > } > {code} > Does "versionsVisible > 1" should be changed to "versionsVisible >= 1" ? > thanks. -- This message was sent by Atlassian JIRA (v6.3.4#6332)