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 4051910052 for ; Fri, 7 Jun 2013 18:06:21 +0000 (UTC) Received: (qmail 35827 invoked by uid 500); 7 Jun 2013 18:06:21 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 35783 invoked by uid 500); 7 Jun 2013 18:06:21 -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 35708 invoked by uid 99); 7 Jun 2013 18:06:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jun 2013 18:06:20 +0000 Date: Fri, 7 Jun 2013 18:06:20 +0000 (UTC) From: "Sergey Shelukhin (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-8709) consider a scheme to allow compacting files in any combination 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-8709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13678229#comment-13678229 ] Sergey Shelukhin commented on HBASE-8709: ----------------------------------------- Well, I guess you could store ranges in header, and then have each KV contain few bits for which range it's coming from, but that now becomes complex. > consider a scheme to allow compacting files in any combination > -------------------------------------------------------------- > > Key: HBASE-8709 > URL: https://issues.apache.org/jira/browse/HBASE-8709 > Project: HBase > Issue Type: Brainstorming > Components: Compaction, HFile > Reporter: Sergey Shelukhin > > We were discussing something and I came up with the following scheme. Consider this. The main problem for choosing out-of-order files for compactions is full key collisions (k, cf:c, ts are the same). We rely on file seqnum to resolve these. There'd be no problem if we stored seqnum for each KV, but that is an overkill. What can we do is this. > 1) Store min seqnum for a file together with the max. Assume file seqnum ranges don't overlap. > 2) Store seqnum for each KV in memory of the memstore. > 3) On flush, don't write out seqnums unless there's a full conflict inside this memstore. We will have to change file format unfortunately to tuck on a bit somewhere to indicate there's varint seqnum. > 4) On compaction, when dropping versions we can drop these seqnums. > 5) On compaction, if we see a full conflict with no seqnums (i.e. KVs coming from different files), write out seqnums for the KVs involved as median of the respective file ranges (or something like that). We only ever use these KVs to resolve full conflicts so we don't care about relations between keys. > Both of the places where we write seqnums we will need to see the next KV before writing previous KV, so there's some complexity, however the "buffering" is never more than one KV long - if we see different k-c-t we know we don't need a seqnum unless we are in conflict with previous KVs which we have already written, if we see the same one we know we need a seqnum. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira