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

TestHLogSplit fails when it sets a KV size to be negative

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.98.0, 0.99.0, 0.96.1.1, 0.94.17
    • 0.96.2, 0.98.1, 0.99.0, 0.94.18
    • wal
    • None
    • Reviewed

    Description

      From jdcryans:

      java.lang.NegativeArraySizeException
      	at org.apache.hadoop.hbase.KeyValue.readFields(KeyValue.java:2259)
      	at org.apache.hadoop.hbase.KeyValue.readFields(KeyValue.java:2266)
      	at org.apache.hadoop.hbase.codec.KeyValueCodec$KeyValueDecoder.parseCell(KeyValueCodec.java:64)
      	at org.apache.hadoop.hbase.codec.BaseDecoder.advance(BaseDecoder.java:46)
      	at org.apache.hadoop.hbase.regionserver.wal.WALEdit.readFields(WALEdit.java:222)
      	at org.apache.hadoop.io.SequenceFile$Reader.getCurrentValue(SequenceFile.java:2114)
      	at org.apache.hadoop.io.SequenceFile$Reader.next(SequenceFile.java:2242)
      	at org.apache.hadoop.hbase.regionserver.wal.SequenceFileLogReader.next(SequenceFileLogReader.java:245)
      	at org.apache.hadoop.hbase.regionserver.wal.SequenceFileLogReader.next(SequenceFileLogReader.java:214)
      	at org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.getNextLogLine(HLogSplitter.java:799)
      	at org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.parseHLog(HLogSplitter.java:727)
      	at org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.splitLog(HLogSplitter.java:307)
      	at org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.splitLog(HLogSplitter.java:217)
      	at org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.splitLog(HLogSplitter.java:180)
      	at org.apache.hadoop.hbase.regionserver.wal.TestHLogSplit.testMiddleGarbageCorruptionSkipErrorsReadsHalfOfFile(TestHLogSplit.java:363)
      ...
      

      It seems to me that we're reading a negative length which we use to create the byte array and since it's not an IOE we don't treat it as a corrupted log. I'm surprised that not a single build has failed like this in the past 3 years.

      Attachments

        1. HBASE-10718.v0.txt
          3 kB
          Esteban Gutierrez
        2. HBASE-10718.v1.txt
          3 kB
          Esteban Gutierrez
        3. HBASE-10718.v2.txt
          3 kB
          Esteban Gutierrez
        4. HBASE-10718.v3.txt
          3 kB
          Esteban Gutierrez
        5. HBASE-10718.v3-0.94.txt
          3 kB
          Esteban Gutierrez

        Activity

          People

            esteban Esteban Gutierrez
            esteban Esteban Gutierrez
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: