HBase
  1. HBase
  2. HBASE-435

TestTableMapReduce failed in HBase-Patch #15

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.2.0
    • Fix Version/s: 0.2.0
    • Component/s: test
    • Labels:
      None

      Description

      TestTableMapReduce failed in HBase-Patch #15 see: http://hudson.zones.apache.org/hudson/job/HBase-Patch/15/testReport/

      java.lang.NullPointerException
      at org.apache.hadoop.hbase.HRegionServer$QueueEntry.hashCode(HRegionServer.java:187)
      at org.apache.hadoop.hbase.HRegionServer$QueueEntry.equals(HRegionServer.java:181)
      at java.util.AbstractCollection.contains(AbstractCollection.java:101)
      at org.apache.hadoop.hbase.HRegionServer$Flusher.flushRequested(HRegionServer.java:494)
      at org.apache.hadoop.hbase.MultiRegionTable.makeMultiRegionTable(MultiRegionTable.java:107)
      at org.apache.hadoop.hbase.mapred.TestTableMapReduce.localTestMultiRegionTable(TestTableMapReduce.java:284)
      at org.apache.hadoop.hbase.mapred.TestTableMapReduce.testTableMapReduce(TestTableMapReduce.java:205)

        Issue Links

          Activity

          Hide
          stack added a comment -

          Thats an odd one Jim. You have an idea why?

          Show
          stack added a comment - Thats an odd one Jim. You have an idea why?
          Hide
          Jim Kellerman added a comment -

          In MultiRegionTable.makeMultiRegionTable, it is possible to run out of retries in the following loop and exit the loop with a null HRegion:

          HRegion r = null;
          for (int i = 0; i < 30; i++) {
          hri = t.getRegionLocation(HConstants.EMPTY_START_ROW).getRegionInfo();
          LOG.info("Region location: " + hri);
          r = cluster.getRegionThreads().get(0).getRegionServer().
          onlineRegions.get(hri.getRegionName());
          if (r != null)

          { break; }

          try

          { Thread.sleep(1000); }

          catch (InterruptedException e)

          { LOG.warn("Waiting on region to come online", e); }

          }

          // Flush the cache
          cluster.getRegionThreads().get(0).getRegionServer().getCacheFlushListener().
          flushRequested(r);

          If you fall out of the loop after 30 retries, r is null and so you get the NPE from inside of flushRequested which is trying to do:

          QueueEntry e = new QueueEntry(region, System.currentTimeMillis());
          synchronized (flushQueue) {
          if (flushQueue.contains(e)) {

          QueueEntry.equals is based on the its hashCode which is computed by:

          public int hashCode()

          { return this.region.getRegionInfo().hashCode(); }

          So if region is null, dereferencing it will generate the NPE

          Show
          Jim Kellerman added a comment - In MultiRegionTable.makeMultiRegionTable, it is possible to run out of retries in the following loop and exit the loop with a null HRegion: HRegion r = null; for (int i = 0; i < 30; i++) { hri = t.getRegionLocation(HConstants.EMPTY_START_ROW).getRegionInfo(); LOG.info("Region location: " + hri); r = cluster.getRegionThreads().get(0).getRegionServer(). onlineRegions.get(hri.getRegionName()); if (r != null) { break; } try { Thread.sleep(1000); } catch (InterruptedException e) { LOG.warn("Waiting on region to come online", e); } } // Flush the cache cluster.getRegionThreads().get(0).getRegionServer().getCacheFlushListener(). flushRequested(r); If you fall out of the loop after 30 retries, r is null and so you get the NPE from inside of flushRequested which is trying to do: QueueEntry e = new QueueEntry(region, System.currentTimeMillis()); synchronized (flushQueue) { if (flushQueue.contains(e)) { QueueEntry.equals is based on the its hashCode which is computed by: public int hashCode() { return this.region.getRegionInfo().hashCode(); } So if region is null, dereferencing it will generate the NPE
          Hide
          Jim Kellerman added a comment -

          HBASE-43[45] TestTableIndex and TestTableMapReduce failed in Hudson builds - patches passed per Bryan Duxbury

          Show
          Jim Kellerman added a comment - HBASE-43 [45] TestTableIndex and TestTableMapReduce failed in Hudson builds - patches passed per Bryan Duxbury

            People

            • Assignee:
              Jim Kellerman
              Reporter:
              Jim Kellerman
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development