You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2023/02/26 06:59:00 UTC
[jira] [Created] (HBASE-27668) PB's parseDelimitedFrom can successfully return when there are not enough bytes
Duo Zhang created HBASE-27668:
---------------------------------
Summary: PB's parseDelimitedFrom can successfully return when there are not enough bytes
Key: HBASE-27668
URL: https://issues.apache.org/jira/browse/HBASE-27668
Project: HBase
Issue Type: Bug
Components: Protobufs, wal
Reporter: Duo Zhang
Fix For: 2.6.0, 3.0.0-alpha-4, 2.4.17, 2.5.4
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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)