Details
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
- links to