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

Zheng Hu commented on HBASE-21594:
----------------------------------

I run the test by using you code and hfile, seems not the same problem ? 
{code}
Exception in thread "main" 
org.apache.hadoop.hbase.io.hfile.CorruptHFileException: Problem reading HFile 
Trailer from file 
file:/home/openinx/Downloads/2e4db6a7f8d14f2bb846781b07750dc1_SeqId_84_.bak
        at org.apache.hadoop.hbase.io.hfile.HFile.openReader(HFile.java:528)
        at org.apache.hadoop.hbase.io.hfile.HFile.createReader(HFile.java:576)
        at org.apache.hadoop.hbase.io.TestHFile.main(TestHFile.java:38)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.IllegalArgumentException: Invalid HFile version: 5593857 
(expected to be between 2 and 3)
        at 
org.apache.hadoop.hbase.io.hfile.HFile.checkFormatVersion(HFile.java:931)
        at 
org.apache.hadoop.hbase.io.hfile.FixedFileTrailer.readFromStream(FixedFileTrailer.java:402)
        at org.apache.hadoop.hbase.io.hfile.HFile.openReader(HFile.java:513)
        ... 7 more
{code}

> Requested block is out of range when reading hfile
> --------------------------------------------------
>
>                 Key: HBASE-21594
>                 URL: https://issues.apache.org/jira/browse/HBASE-21594
>             Project: HBase
>          Issue Type: Bug
>          Components: HFile
>    Affects Versions: 0.98.10
>            Reporter: ChenKai
>            Assignee: Zheng Hu
>            Priority: Major
>         Attachments: 2e4db6a7f8d14f2bb846781b07750dc1_SeqId_84_.bak, 
> image-2018-12-13-20-11-00-818.png
>
>
> My HFiles are generated by Spark HBaseBulkLoad. And then when i read a few of 
> them(or hbase do compact), i encounter the following exceptions.
>  
> {code:java}
> Exception in thread "main" java.io.IOException: Requested block is out of 
> range: 77329641, lastDataBlockOffset: 77329641, 
> trailer.getLoadOnOpenDataOffset: 77329641
> at 
> org.apache.hadoop.hbase.io.hfile.HFileReaderV2.readBlock(HFileReaderV2.java:396)
> at 
> org.apache.hadoop.hbase.io.hfile.HFileReaderV2$AbstractScannerV2.readNextDataBlock(HFileReaderV2.java:734)
> at 
> org.apache.hadoop.hbase.io.hfile.HFileReaderV2$ScannerV2.isNextBlock(HFileReaderV2.java:859)
> at 
> org.apache.hadoop.hbase.io.hfile.HFileReaderV2$ScannerV2.positionForNextBlock(HFileReaderV2.java:854)
> at 
> org.apache.hadoop.hbase.io.hfile.HFileReaderV2$ScannerV2._next(HFileReaderV2.java:871)
> at 
> org.apache.hadoop.hbase.io.hfile.HFileReaderV2$ScannerV2.next(HFileReaderV2.java:891)
> at io.patamon.hbase.test.read.TestHFileRead.main(TestHFileRead.java:49)
> {code}
> Looks like `lastDataBlockOffset` is equals to 
> `trailer.getLoadOnOpenDataOffset`. Could anyone help me? Thanks very much.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to