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 4E1031896F for ; Tue, 11 Aug 2015 09:32:53 +0000 (UTC) Received: (qmail 66211 invoked by uid 500); 11 Aug 2015 09:32:47 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 66158 invoked by uid 500); 11 Aug 2015 09:32:46 -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 66145 invoked by uid 99); 11 Aug 2015 09:32:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Aug 2015 09:32:46 +0000 Date: Tue, 11 Aug 2015 09:32:46 +0000 (UTC) From: "Anton Nazaruk (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-14206) MultiRowRangeFilter returns records whose rowKeys are out of allowed ranges 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-14206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Anton Nazaruk updated HBASE-14206: ---------------------------------- Priority: Critical (was: Major) > MultiRowRangeFilter returns records whose rowKeys are out of allowed ranges > --------------------------------------------------------------------------- > > Key: HBASE-14206 > URL: https://issues.apache.org/jira/browse/HBASE-14206 > Project: HBase > Issue Type: Bug > Affects Versions: 1.1.0 > Environment: linux, java7 > Reporter: Anton Nazaruk > Assignee: Ted Yu > Priority: Critical > Labels: filter > > I haven't found a way to attach test program to JIRA issue, so put it below : > {code} > public class MultiRowRangeFilterTest { > > byte[] key1Start = new byte[] {-3}; > byte[] key1End = new byte[] {-2}; > byte[] key2Start = new byte[] {5}; > byte[] key2End = new byte[] {6}; > byte[] badKey = new byte[] {-10}; > @Test > public void testRanges() throws IOException { > MultiRowRangeFilter filter = new MultiRowRangeFilter(Arrays.asList( > new MultiRowRangeFilter.RowRange(key1Start, true, key1End, false), > new MultiRowRangeFilter.RowRange(key2Start, true, key2End, false) > )); > filter.filterRowKey(badKey, 0, 1); > /* > * FAILS -- includes BAD key! > * Expected :SEEK_NEXT_USING_HINT > * Actual :INCLUDE > * */ > assertEquals(Filter.ReturnCode.SEEK_NEXT_USING_HINT, filter.filterKeyValue(null)); > } > } > {code} > It seems to happen on 2.0.0-SNAPSHOT too, but I wasn't able to link one with included class. > I have played some time with algorithm, and found that quick fix may be applied to "getNextRangeIndex(byte[] rowKey)" method (hbase-client:1.1.0) : > {code} > if (insertionPosition == 0 && !rangeList.get(insertionPosition).contains(rowKey)) { > return ROW_BEFORE_FIRST_RANGE; > } > // FIX START > if(!this.initialized) { > this.initialized = true; > } > // FIX END > return insertionPosition; > {code} > Thanks, hope it will help. -- This message was sent by Atlassian JIRA (v6.3.4#6332)