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

PB's parseDelimitedFrom can successfully return when there are not enough bytes

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      Found this when writing some UTs for parsing partial header and trailer, WALHeader.parseDelimitedFrom can return successfully when there are only two bytes in the stream(only the length, actually).

      So I know why in the past we have a followingKvCount == 0 check in ProtobufLogReader, as we just want to prevent the partial PB message.

      This is a very critial problem, for me I think we should provide our own implementation of parseDelimitedFrom for some critical usages, for example, when reading WAL entries. If there are not enough data, we just throw exception out instead of returning a partial PB message.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: