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 5B1126BD8 for ; Tue, 14 Jun 2011 22:31:17 +0000 (UTC) Received: (qmail 82359 invoked by uid 500); 14 Jun 2011 22:31:16 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 82309 invoked by uid 500); 14 Jun 2011 22:31:16 -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 82205 invoked by uid 99); 14 Jun 2011 22:31:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2011 22:31:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2011 22:31:14 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id DD0AC4164D7 for ; Tue, 14 Jun 2011 22:30:54 +0000 (UTC) Date: Tue, 14 Jun 2011 22:30:54 +0000 (UTC) From: "Mikhail Bautin (JIRA)" To: issues@hbase.apache.org Message-ID: <1496993354.4718.1308090654901.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1369644223.4706.1308090527625.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (HBASE-3987) Fix a NullPointerException on a failure to load Bloom filter data 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-3987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mikhail Bautin updated HBASE-3987: ---------------------------------- Release Note: Index: src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java (revision 1135828) +++ src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java (working copy) @@ -983,7 +983,8 @@ } private boolean passesBloomFilter(Scan scan, final SortedSet columns) { - if (this.bloomFilter == null || !scan.isGetScan()) { + BloomFilter bloomFilter = this.bloomFilter; + if (bloomFilter == null || !scan.isGetScan()) { return true; } byte[] row = scan.getStartRow(); @@ -1011,11 +1012,11 @@ // columns, a file might be skipped if using row+col Bloom filter. // In order to ensure this file is included an additional check is // required looking only for a row bloom. - return this.bloomFilter.contains(key, bloom) || - this.bloomFilter.contains(row, bloom); + return bloomFilter.contains(key, bloom) || + bloomFilter.contains(row, bloom); } else { - return this.bloomFilter.contains(key, bloom); + return bloomFilter.contains(key, bloom); } } } catch (IOException e) { Status: Patch Available (was: Open) > Fix a NullPointerException on a failure to load Bloom filter data > ----------------------------------------------------------------- > > Key: HBASE-3987 > URL: https://issues.apache.org/jira/browse/HBASE-3987 > Project: HBase > Issue Type: Bug > Components: regionserver > Affects Versions: 0.90.3, 0.90.2, 0.90.1, 0.90.0, 0.89.20100924, 0.89.20100621 > Reporter: Mikhail Bautin > Assignee: Mikhail Bautin > Fix For: 0.94.0 > > Original Estimate: 24h > Remaining Estimate: 24h > > This is a fix for an NullPointerException that happens in passesBloomFilter. The meta block fails to load, and the IOException catch block sets the Bloom filter to null. Then all other threads waiting on the Bloom filter to load get a chance to try to load the meta block, and one of them eventually succeeds and goes on to query the Bloom filter in StoreFile.passesBloomFilter, but bloomFilter has been already set to null. The fix is to cache the bloomFilter variable in a local variable in passesBloomFilter so that it cannot be made null while the thread is waiting for another thread to load Bloom filter bits. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira