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

CompactionRequest#toString() may throw NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.96.0
    • 0.99.0, 0.98.2
    • None
    • None
    • Reviewed

    Description

      I found the following in hbase-server/target/surefire-reports/org.apache.hadoop.hbase.util.TestMergeTable-output.txt :

      2014-03-08 01:22:35,311 INFO  [IPC Server handler 0 on 39151] blockmanagement.BlockManager(1009): BLOCK* addToInvalidates: blk_1073741852_1028 127.0.0.1:58684
      2014-03-08 01:22:35,312 INFO  [RS:0;kiyo:45971-shortCompactions-1394241753752] regionserver.HRegion(1393): compaction interrupted
      java.io.InterruptedIOException: Aborting compaction of store contents in region test,,1394241738901.edbcdf3be9dd27c52b1fca1b09a5a582. because it was interrupted.
              at org.apache.hadoop.hbase.regionserver.compactions.DefaultCompactor.compact(DefaultCompactor.java:81)
              at org.apache.hadoop.hbase.regionserver.DefaultStoreEngine$DefaultCompactionContext.compact(DefaultStoreEngine.java:109)
              at org.apache.hadoop.hbase.regionserver.HStore.compact(HStore.java:1131)
              at org.apache.hadoop.hbase.regionserver.HRegion.compact(HRegion.java:1390)
              at org.apache.hadoop.hbase.regionserver.CompactSplitThread$CompactionRunner.run(CompactSplitThread.java:475)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at java.lang.Thread.run(Thread.java:724)
      2014-03-08 01:22:35,314 DEBUG [RS_CLOSE_REGION-kiyo:45971-0] regionserver.HRegion(1069): Updates disabled for region test,,1394241738901.edbcdf3be9dd27c52b1fca1b09a5a582.
      2014-03-08 01:22:35,316 INFO  [StoreCloserThread-test,,1394241738901.edbcdf3be9dd27c52b1fca1b09a5a582.-1] regionserver.HStore(793): Closed contents
      2014-03-08 01:22:35,316 ERROR [RS:0;kiyo:45971-shortCompactions-1394241753752] regionserver.CompactSplitThread$CompactionRunner(496): Compaction failed Request = regionName=test,,1394241738901.edbcdf3be9dd27c52b1fca1b09a5a582., storeName=contents, fileCount=7, fileSize=71.3 M (10.2 M, 10.2 M, 10.2 M, 10.2 M, 10.2 M), priority=3, time=8144240699213330
      java.lang.NullPointerException
              at org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest$2.apply(CompactionRequest.java:213)
              at org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest$2.apply(CompactionRequest.java:211)
              at com.google.common.collect.Iterators$9.transform(Iterators.java:845)
              at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
              at com.google.common.base.Joiner.appendTo(Joiner.java:125)
              at com.google.common.base.Joiner.appendTo(Joiner.java:186)
              at com.google.common.base.Joiner.join(Joiner.java:243)
              at com.google.common.base.Joiner.join(Joiner.java:232)
              at org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest.toString(CompactionRequest.java:204)
              at java.lang.String.valueOf(String.java:2854)
              at java.lang.StringBuilder.append(StringBuilder.java:128)
              at org.apache.hadoop.hbase.regionserver.CompactSplitThread$CompactionRunner.toString(CompactSplitThread.java:425)
              at java.lang.String.valueOf(String.java:2854)
              at java.lang.StringBuilder.append(StringBuilder.java:128)
              at org.apache.hadoop.hbase.regionserver.CompactSplitThread$CompactionRunner.run(CompactSplitThread.java:477)
      

      The exception came from apply() method:

                }), new Function<StoreFile, String>() {
                  public String apply(StoreFile sf) {
                    return StringUtils.humanReadableInt(sf.getReader().length());
                  }
                }));
      

      Looks like sf.getReader() might become null when StringUtils.humanReadableInt() is called

      Attachments

        1. 10705-v2.txt
          1 kB
          Ted Yu
        2. HBASE-10705.1.patch
          0.9 kB
          Rekha Joshi

        Activity

          People

            rekhajoshm Rekha Joshi
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: