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 AF53D11A84 for ; Mon, 21 Jul 2014 23:14:39 +0000 (UTC) Received: (qmail 54984 invoked by uid 500); 21 Jul 2014 23:14:39 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 54943 invoked by uid 500); 21 Jul 2014 23:14:39 -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 54926 invoked by uid 99); 21 Jul 2014 23:14:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2014 23:14:39 +0000 Date: Mon, 21 Jul 2014 23:14:39 +0000 (UTC) From: "Hudson (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-11541) Wrong result when scaning meta with startRow 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-11541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14069490#comment-14069490 ] Hudson commented on HBASE-11541: -------------------------------- SUCCESS: Integrated in HBase-0.98 #409 (See [https://builds.apache.org/job/HBase-0.98/409/]) HBASE-11541 Wrong result when scaning meta with startRow (Liu Shaoqui) (stack: rev df8921a79aedce49c09cced4f0f50c5c54ec513b) * hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java * hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java > Wrong result when scaning meta with startRow > -------------------------------------------- > > Key: HBASE-11541 > URL: https://issues.apache.org/jira/browse/HBASE-11541 > Project: HBase > Issue Type: Bug > Reporter: Liu Shaohui > Assignee: Liu Shaohui > Priority: Minor > Fix For: 0.99.0, 0.98.5, 2.0.0 > > Attachments: HBASE-11541-trunk-v1.diff, HBASE-11541.patch, HBASE-11541.patch > > > When we scan the meta with STARTROW optiion, wrong result may be returned. > For exmaple: if there are two tables named "a" and "b" in hbase, when we scan the meta with startrow = 'b', the region location of table "a" will be returned but we expect to get the region location of table "b". > {code} > > create 'a', {NAME => 'f'} > > create 'b', {NAME => 'f'} > > scan '.META.', {STARTROW => 'b', LIMIT => 1} > a,,1405655897758.f8b547476b6dc80545e6413c31396, xxxx > {code} > The reason is the wrong assumption in MetaKeyComparator > See: KeyValue.java#2011 > {code} > int leftDelimiter = getDelimiter(left, loffset, llength, > HRegionInfo.DELIMITER); > int rightDelimiter = getDelimiter(right, roffset, rlength, > HRegionInfo.DELIMITER); > if (leftDelimiter < 0 && rightDelimiter >= 0) { > // Nothing between .META. and regionid. Its first key. > return -1; > } else if (rightDelimiter < 0 && leftDelimiter >= 0) { > return 1; > } else if (leftDelimiter < 0 && rightDelimiter < 0) { > return 0; > } > {code} > It's a little troublesome to fix this problem for given a start row which contains more than two "," for meta, it's not easy to extract the startKey of region. > eg: STARTROW => 'aaa,bbb,ccc,xxx'. > Comments and suggestions are welcomed. Thanks -- This message was sent by Atlassian JIRA (v6.2#6252)