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 CD4B1C1CB for ; Tue, 30 Dec 2014 07:18:13 +0000 (UTC) Received: (qmail 50336 invoked by uid 500); 30 Dec 2014 07:18:14 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 50298 invoked by uid 500); 30 Dec 2014 07:18:14 -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 50286 invoked by uid 99); 30 Dec 2014 07:18:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Dec 2014 07:18:14 +0000 Date: Tue, 30 Dec 2014 07:18:13 +0000 (UTC) From: "Hudson (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-12767) Fix a StoreFileScanner NPE in reverse scan flow 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-12767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14260876#comment-14260876 ] Hudson commented on HBASE-12767: -------------------------------- FAILURE: Integrated in HBase-0.98 #763 (See [https://builds.apache.org/job/HBase-0.98/763/]) HBASE-12767 Fix a StoreFileScanner NPE in reverse scan flow (xieliang: rev 3197a631dbdf8cee7ba8fe1ea4864ac55fde5a43) * hbase-server/src/main/java/org/apache/hadoop/hbase/io/HalfStoreFileReader.java * hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java > Fix a StoreFileScanner NPE in reverse scan flow > ----------------------------------------------- > > Key: HBASE-12767 > URL: https://issues.apache.org/jira/browse/HBASE-12767 > Project: HBase > Issue Type: Bug > Components: regionserver, Scanners > Affects Versions: 1.0.0, 2.0.0, 0.98.9 > Reporter: Liang Xie > Assignee: Liang Xie > Fix For: 1.0.0, 2.0.0, 0.98.10, 1.1.0 > > Attachments: HBASE-12767.txt > > > we observed a NPE in our internal 0.94 branch prd env: > ERROR org.apache.hadoop.hbase.regionserver.HRegionServer: Failed openScanner > java.lang.NullPointerException > at org.apache.hadoop.hbase.regionserver.StoreFileScanner.seekToPreviousRow(StoreFileScanner.java:409) > at org.apache.hadoop.hbase.regionserver.StoreFileScanner.backwardSeek(StoreFileScanner.java:467) > at org.apache.hadoop.hbase.regionserver.ReversedStoreScanner.seekScanners(ReversedStoreScanner.java:78) > at org.apache.hadoop.hbase.regionserver.StoreScanner.(StoreScanner.java:154) > at org.apache.hadoop.hbase.regionserver.ReversedStoreScanner.(ReversedStoreScanner.java:49) > at org.apache.hadoop.hbase.regionserver.Store.getScanner(Store.java:2216) > at org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.(HRegion.java:3984) > at org.apache.hadoop.hbase.regionserver.ReversedRegionScannerImpl.(ReversedRegionScannerImpl.java:43) > at org.apache.hadoop.hbase.regionserver.HRegion.instantiateRegionScanner(HRegion.java:1851) > at org.apache.hadoop.hbase.regionserver.HRegion.getScanner(HRegion.java:1837) > at org.apache.hadoop.hbase.regionserver.HRegion.getScanner(HRegion.java:1812) > at org.apache.hadoop.hbase.regionserver.HRegionServer.internalOpenScanner(HRegionServer.java:2752) > at org.apache.hadoop.hbase.regionserver.HRegionServer.openScanner(HRegionServer.java:2715) > After tracing, it turned out a boundary bug at HalfStoreFileReader. If we have a reverse scan request at "bottom" part, once the start row >= the last row at bottom part, the NPE will be encourtered, since we will invoke "next()", and "atEnd = true" will be called in HalfStoreFileReader, then when we want to do "seekBefore" or other sth in StoreFileScanner, StoreFileScanner.cur will call: > {code} > public Cell getKeyValue() { > if (atEnd) return null; > {code} > The fix is simple, we need to reset the "atEnd" flag once seekBefore op is successful. You can undo my HalfStoreFileReader change and run the new added case to see NPE. > ps: I also found some cases in TestHRegion missing the "@Test" annotation, so fix them in the same patch as well. -- This message was sent by Atlassian JIRA (v6.3.4#6332)