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

RegionInfo.parseFrom(DataInputStream) sometimes fails to read the protobuf magic marker

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.1
    • Fix Version/s: 3.0.0-alpha-1, 2.5.0, 2.3.5, 2.4.3
    • Component/s: Client
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Flags:
      Patch

      Description

      The RegionInfo class uses

       DataInputStream.read(byte[lengthOfPBMagic])
      

      to read the protobuf magic marker from the beginning of the stream.
      The code in RegionInfo assumes that the passed byte buffer will be filled, but the DataInputStream class only guarantees that it will read at most lengthOfPBMagic bytes.
      This sometimes causes errors stating that region info file could not be parsed.
      The fix is to simply issue multiple read calls until lengthOfPBMagic bytes have been read.

        Attachments

        1. HBASE_25674-2.4.1.patch
          2 kB
          Constantin-Catalin Luca

          Issue Links

            Activity

              People

              • Assignee:
                catalin.luca Constantin-Catalin Luca
                Reporter:
                catalin.luca Constantin-Catalin Luca
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: