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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.1
    • 3.0.0-alpha-1, 2.5.0, 2.3.5, 2.4.3
    • Client
    • None
    • Reviewed
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: