You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Wellington Chevreuil (Jira)" <ji...@apache.org> on 2021/03/17 14:15:00 UTC

[jira] [Commented] (HBASE-25674) RegionInfo.parseFrom(DataInputStream) sometimes fails to read the protobuf magic marker

    [ https://issues.apache.org/jira/browse/HBASE-25674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17303472#comment-17303472 ] 

Wellington Chevreuil commented on HBASE-25674:
----------------------------------------------

Thanks for filing this, [~catalin.luca]. Does this also affect master branch? If so, please create a PR for master branch first, then we will backport it to all affected lower branches. Also, we don't do patch reviews anymore, please submit this a github pull request.

> RegionInfo.parseFrom(DataInputStream) sometimes fails to read the protobuf magic marker
> ---------------------------------------------------------------------------------------
>
>                 Key: HBASE-25674
>                 URL: https://issues.apache.org/jira/browse/HBASE-25674
>             Project: HBase
>          Issue Type: Bug
>          Components: Client
>    Affects Versions: 2.4.1
>            Reporter: Constantin-Catalin Luca
>            Assignee: Constantin-Catalin Luca
>            Priority: Minor
>         Attachments: HBASE_25674-2.4.1.patch
>
>
> The RegionInfo class uses
> {code:java}
>  DataInputStream.read(byte[lengthOfPBMagic])
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)