Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-20135

NullPointerException during reading bloom filter when upgraded from hbase-1 to hbase-2

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0.0-beta-2
    • 2.0.0
    • None
    • None
    • Reviewed

    Description

      When upgraded from hbase-1 to hbase-2, found following exception logged multiple times in the log:

      ERROR [StoreFileOpenerThread-test_cf-1] regionserver.StoreFileReader: Error reading bloom filter meta for GENERAL_BLOOM_META -- proceeding without
      java.io.IOException: Comparator class org.apache.hadoop.hbase.KeyValue$RawBytesComparator is not instantiable
              at org.apache.hadoop.hbase.io.hfile.FixedFileTrailer.createComparator(FixedFileTrailer.java:628)
              at org.apache.hadoop.hbase.io.hfile.CompoundBloomFilter.<init>(CompoundBloomFilter.java:79)
              at org.apache.hadoop.hbase.util.BloomFilterFactory.createFromMeta(BloomFilterFactory.java:104)
              at org.apache.hadoop.hbase.regionserver.StoreFileReader.loadBloomfilter(StoreFileReader.java:479)
              at org.apache.hadoop.hbase.regionserver.HStoreFile.open(HStoreFile.java:425)
              at org.apache.hadoop.hbase.regionserver.HStoreFile.initReader(HStoreFile.java:460)
              at org.apache.hadoop.hbase.regionserver.HStore.createStoreFileAndReader(HStore.java:671)
              at org.apache.hadoop.hbase.regionserver.HStore.lambda$openStoreFiles$0(HStore.java:537)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.NullPointerException

       
      Analysis from anoop.hbase:
      Checking the related code.  There seems no issue..  We are not going
      to even fail reading the bloom.  In 2.0 code base we expect the
      comparator class name to be null.  But in 1.x we write old KV based
      Raw Bytes comparator class name.  So reading that back, we will return
      class name as null and we get NPE it looks like.

       else if (comparatorClassName.equals("org.apache.hadoop.hbase.KeyValue$RawBytesComparator")
              || comparatorClassName.equals("org.apache.hadoop.hbase.util.Bytes$ByteArrayComparator"))
      {
            // When the comparator to be used is Bytes.BYTES_RAWCOMPARATOR,
      we just return null from here
            // Bytes.BYTES_RAWCOMPARATOR is not a CellComparator
            comparatorKlass = null;
          }
      

      We can better do a null check before trying the comparator class
      instantiation so that we can avoid this scary error logs

      Attachments

        1. hbase-20135.master.002.patch
          6 kB
          Sakthi
        2. hbase-20135.master.001.patch
          5 kB
          Sakthi

        Issue Links

          Activity

            People

              sakthi Sakthi
              uagashe Umesh Agashe
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: