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 A4143185C9 for ; Tue, 22 Sep 2015 22:19:05 +0000 (UTC) Received: (qmail 75881 invoked by uid 500); 22 Sep 2015 22:19:05 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 75840 invoked by uid 500); 22 Sep 2015 22:19:05 -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 75826 invoked by uid 99); 22 Sep 2015 22:19:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Sep 2015 22:19:05 +0000 Date: Tue, 22 Sep 2015 22:19:05 +0000 (UTC) From: "Hudson (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-14397) PrefixFilter doesn't filter all remaining rows if the prefix is longer than rowkey being compared 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-14397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14903557#comment-14903557 ] Hudson commented on HBASE-14397: -------------------------------- FAILURE: Integrated in HBase-1.3-IT #175 (See [https://builds.apache.org/job/HBase-1.3-IT/175/]) HBASE-14397 Revert pending review comments (tedyu: rev 992856c11dbe6551807931c6a5a31efacb9ec80b) * hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java > PrefixFilter doesn't filter all remaining rows if the prefix is longer than rowkey being compared > ------------------------------------------------------------------------------------------------- > > Key: HBASE-14397 > URL: https://issues.apache.org/jira/browse/HBASE-14397 > Project: HBase > Issue Type: Improvement > Components: Filters > Affects Versions: 2.0.0 > Reporter: Jianwei Cui > Assignee: Jianwei Cui > Priority: Minor > Attachments: HBASE-14397-trunk-v1.patch > > > The PrefixFilter will filter rowkey as: > {code} > public boolean filterRowKey(Cell firstRowCell) { > ... > int length = firstRowCell.getRowLength(); > if (length < prefix.length) return true; // ===> return directly if the prefix is longer > .... > if ((!isReversed() && cmp > 0) || (isReversed() && cmp < 0)) { > passedPrefix = true; > } > filterRow = (cmp != 0); > return filterRow; > } > {code} > If the prefix is longer than the current rowkey, PrefixFilter#filterRowKey will filter the rowkey directly without comparing, so that won't set 'passedPrefix' flag even the current row is larger than the prefix. > For example, if there are three rows 'a', 'b' and 'c' in the table, and we issue a scan request as: > {code} > hbase(main):001:0> scan 'test_table', {STARTROW => 'a', FILTER => "(PrefixFilter ('aa'))"} > {code} > The region server will check the three rows before returning. In our production, the user issue a scan with a PrefixFilter. The prefix is longer than the rowkeys of following millions of rows, so the region server will continue to check rows until hit a rowkey longer than the prefix. This make the client easily timeout. To fix this case, it seems we need to compare the prefix with the rowkey every serveral rows even when the prefix is longer. -- This message was sent by Atlassian JIRA (v6.3.4#6332)