hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yu Sun (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-17020) keylen in midkey() dont computed correctly
Date Tue, 08 Nov 2016 10:14:59 GMT

     [ https://issues.apache.org/jira/browse/HBASE-17020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Yu Sun updated HBASE-17020:
---------------------------
    Attachment: HBASE-17020-v2.patch

attach version v2, add a ut to reproduct ArrayIndexOutOfBoundsException

> keylen in midkey() dont computed correctly
> ------------------------------------------
>
>                 Key: HBASE-17020
>                 URL: https://issues.apache.org/jira/browse/HBASE-17020
>             Project: HBase
>          Issue Type: Bug
>          Components: HFile
>            Reporter: Yu Sun
>            Assignee: Yu Sun
>         Attachments: HBASE-17020-v1.patch, HBASE-17020-v2.patch
>
>
> in CellBasedKeyBlockIndexReader.midkey():
> {code}
>           ByteBuff b = midLeafBlock.getBufferWithoutHeader();
>           int numDataBlocks = b.getIntAfterPosition(0);
>           int keyRelOffset = b.getIntAfterPosition(Bytes.SIZEOF_INT * (midKeyEntry +
1));
>           int keyLen = b.getIntAfterPosition(Bytes.SIZEOF_INT * (midKeyEntry + 2)) -
keyRelOffset;
> {code}
> the local varible keyLen get this should be total length of: SECONDARY_INDEX_ENTRY_OVERHEAD
 + firstKey.length;
> the code is:
> {code}
>     void add(byte[] firstKey, long blockOffset, int onDiskDataSize,
>         long curTotalNumSubEntries) {
>       // Record the offset for the secondary index
>       secondaryIndexOffsetMarks.add(curTotalNonRootEntrySize);
>       curTotalNonRootEntrySize += SECONDARY_INDEX_ENTRY_OVERHEAD
>           + firstKey.length;
> {code}
> when the midkey last entry of a leaf-level index block, this may throw:
> {quote}
> 2016-10-01 12:27:55,186 ERROR [MemStoreFlusher.0] regionserver.MemStoreFlusher: Cache
flusher failed for entry [flush region pora_6_item_feature,0061:,1473838922457.12617bc4ebbfd171018bf96ac9bdd2a7.]
> java.lang.ArrayIndexOutOfBoundsException
>         at org.apache.hadoop.hbase.util.ByteBufferUtils.copyFromBufferToArray(ByteBufferUtils.java:936)
>         at org.apache.hadoop.hbase.nio.SingleByteBuff.toBytes(SingleByteBuff.java:303)
>         at org.apache.hadoop.hbase.io.hfile.HFileBlockIndex$CellBasedKeyBlockIndexReader.midkey(HFileBlockIndex.java:419)
>         at org.apache.hadoop.hbase.io.hfile.HFileReaderImpl.midkey(HFileReaderImpl.java:1519)
>         at org.apache.hadoop.hbase.regionserver.StoreFile$Reader.midkey(StoreFile.java:1520)
>         at org.apache.hadoop.hbase.regionserver.StoreFile.getFileSplitPoint(StoreFile.java:706)
>         at org.apache.hadoop.hbase.regionserver.DefaultStoreFileManager.getSplitPoint(DefaultStoreFileManager.java:126)
>         at org.apache.hadoop.hbase.regionserver.HStore.getSplitPoint(HStore.java:1983)
>         at org.apache.hadoop.hbase.regionserver.ConstantFamilySizeRegionSplitPolicy.getSplitPoint(ConstantFamilySizeRegionSplitPolicy.java:77)
>         at org.apache.hadoop.hbase.regionserver.HRegion.checkSplit(HRegion.java:7756)
>         at org.apache.hadoop.hbase.regionserver.MemStoreFlusher.flushRegion(MemStoreFlusher.java:513)
>         at org.apache.hadoop.hbase.regionserver.MemStoreFlusher.flushRegion(MemStoreFlusher.java:471)
>         at org.apache.hadoop.hbase.regionserver.MemStoreFlusher.access$800(MemStoreFlusher.java:75)
>         at org.apache.hadoop.hbase.regionserver.MemStoreFlusher$FlushHandler.run(MemStoreFlusher.java:259)
>         at java.lang.Thread.run(Thread.java:756)
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message