hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Bautin (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-3987) Fix a NullPointerException on a failure to load Bloom filter data
Date Tue, 14 Jun 2011 22:30:54 GMT

     [ 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<byte[]> 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

        

Mime
View raw message