[ https://issues.apache.org/jira/browse/HBASE-25567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17283400#comment-17283400 ]
Jun Yuan edited comment on HBASE-25567 at 2/11/21, 10:02 PM: ------------------------------------------------------------- In RegionInfo.parseFrom(), the number of bytes read to pbuf is not necessarily equals to pbuf.length. Should use readFully() to read the intended number of bytes {code:java} int read = in.read(pbuf); if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen); {code} Similar issue for HRegionInfo.parseFrom(), Reference.read(), FileInfo.read(), WALCellCodec.uncompressByteString(). was (Author: jyuanca): In RegionInfo.parseFrom(), the number of bytes read to pbuf is not necessarily equals to pbuf.length. Should use readFully() to read the intended number of bytes {code:java} int read = in.read(pbuf); if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen); {code} > HRegionFileSystem.loadRegionInfoFileContent throws IOException occasionally > --------------------------------------------------------------------------- > > Key: HBASE-25567 > URL: https://issues.apache.org/jira/browse/HBASE-25567 > Project: HBase > Issue Type: Bug > Components: regionserver > Affects Versions: 2.1.4 > Reporter: Jun Yuan > Priority: Major > > We invoked HRegionFileSystem.loadRegionInfoFileContent to read .regioninfo > from hdfs, but get an exception occasionally > {code:java} > Caused by: java.io.IOException: read=3, wanted=4 > at org.apache.hadoop.hbase.client.RegionInfo.parseFrom(RegionInfo.java:743) > at > org.apache.hadoop.hbase.regionserver.HRegionFileSystem.loadRegionInfoFileContent(HRegionFileSystem.java:856){code} -- This message was sent by Atlassian Jira (v8.3.4#803005)