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

Data loss when replaying wal if HDFS timeout

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 1.2.0, 1.3.0, 1.0.3, 1.1.3, 0.98.17, 2.0.0
    • 1.2.0, 1.3.0, 1.1.4, 1.0.4, 0.98.18, 2.0.0
    • wal
    • None
    • Reviewed

    Description

      This is a problem introduced by HBASE-13825 where we change the exception type in catch block in readNext method of ProtobufLogReader.

      ProtobufLogReader.java
            try {
                ......
                ProtobufUtil.mergeFrom(builder, new LimitInputStream(this.inputStream, size),
                  (int)size);
              } catch (IOException ipbe) { // <------ used to be InvalidProtocolBufferException
                throw (EOFException) new EOFException("Invalid PB, EOF? Ignoring; originalPosition=" +
                  originalPosition + ", currentPosition=" + this.inputStream.getPos() +
                  ", messageSize=" + size + ", currentAvailable=" + available).initCause(ipbe);
              }
      

      Here if the inputStream throws an IOException due to timeout or something, we just convert it to an EOFException and at the bottom of this method, we ignore EOFException and return false. This cause the upper layer think we reach the end of file. So when replaying we will treat the HDFS timeout error as a normal end of file and cause data loss.

      Attachments

        1. HBASE-15252-addendum-0.98.patch
          2 kB
          Duo Zhang
        2. HBASE-15252-v1.patch
          9 kB
          Duo Zhang
        3. HBASE-15252.patch
          9 kB
          Duo Zhang
        4. HBASE-15252-testcase.patch
          7 kB
          Duo Zhang

        Activity

          People

            zhangduo Duo Zhang
            zhangduo Duo Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: