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

RegionScanner.reseek() creates NPE when a flush or compaction happens before the reseek.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.94.2
    • None
    • None
    • Reviewed

    Description

      HBASE-5520 introduced reseek() on the RegionScanner.
      Now when a scanner is created we have the StoreScanner heap. After this if a flush or compaction happens parallely all the StoreScannerObservers are cleared so that whenever a new next() call happens we tend to recreate the scanner based on the latest store files.
      The reseek() in StoreScanner expects the heap not to be null because always reseek would be called from next()

      public synchronized boolean reseek(KeyValue kv) throws IOException {
          //Heap cannot be null, because this is only called from next() which
          //guarantees that heap will never be null before this call.
          if (explicitColumnQuery && lazySeekEnabledGlobally) {
            return heap.requestSeek(kv, true, useRowColBloom);
          } else {
            return heap.reseek(kv);
          }
        }
      

      Now when we call RegionScanner.reseek() directly using CPs we tend to get a NPE. In our case it happened when a major compaction was going on. I will also attach a testcase to show the problem.

      Attachments

        1. 6900-test.txt
          3 kB
          Lars Hofhansl
        2. HBASE-6900_1.patch
          3 kB
          ramkrishna.s.vasudevan
        3. HBASE-6900.patch
          2 kB
          ramkrishna.s.vasudevan

        Activity

          People

            ram_krish ramkrishna.s.vasudevan
            ram_krish ramkrishna.s.vasudevan
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: