[
https://issues.apache.org/jira/browse/HBASE-1686?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
stack updated HBASE-1686:
-------------------------
Attachment: 1686.patch
Two fixes:
1. Make it so if hfile has no content, you can do basic functions like
getFirstKey and getLastKey without array out of bounds
2. If a major compaction results in no output because all cells
deleted or expired, don't write an output file.
M src/test/org/apache/hadoop/hbase/regionserver/TestCompaction.java
(testMajorCompactingToNoOutput): Compaction test that will produce
no output -- all contents were deleted.
M src/test/org/apache/hadoop/hbase/regionserver/TestStore.java
(testEmptyStoreFile): Test to make sure things basically work
if an empty store hfile under the Store
M src/test/org/apache/hadoop/hbase/io/hfile/TestHFile.java
(testEmptyHFile): Test to make sure hfile basically works if
no content.
M src/java/org/apache/hadoop/hbase/regionserver/StoreFileGetScan.java
Formatting and in getStoreFile, allow that getFirstKey may come
back null.
M src/java/org/apache/hadoop/hbase/regionserver/Store.java
(compact): Javadoc cleanup. Some minor formatting cleanup (compact
needs to be moved out of here and into its own classes but thats
too big a change this close to RC). Made it so can handle a
compaction producing no product. Make the writer instantiation
lazy. Tidied logging a little.
M src/java/org/apache/hadoop/hbase/KeyValue.java
(keyToString): Allow that passed byte may be null. E.g. printing
the first and last key of an empty hfile.
M src/java/org/apache/hadoop/hbase/io/hfile/HFile.java
Test index is empty before getting first and last key.
Javadoc.
> major compaction can create empty store files, causing AIOOB when trying to
> read
> --------------------------------------------------------------------------------
>
> Key: HBASE-1686
> URL: https://issues.apache.org/jira/browse/HBASE-1686
> Project: Hadoop HBase
> Issue Type: Bug
> Affects Versions: 0.20.0
> Reporter: ryan rawson
> Priority: Blocker
> Fix For: 0.20.0
>
> Attachments: 1686.patch
>
>
> here is the backtrace:
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
> at
> org.apache.hadoop.hbase.io.hfile.HFile$Reader.getFirstKey(HFile.java:991)
> at
> org.apache.hadoop.hbase.regionserver.StoreFileGetScan.getStoreFile(StoreFileGetScan.java:84)
> at
> org.apache.hadoop.hbase.regionserver.StoreFileGetScan.get(StoreFileGetScan.java:65)
> at org.apache.hadoop.hbase.regionserver.Store.get(Store.java:1548)
> at org.apache.hadoop.hbase.regionserver.HRegion.get(HRegion.java:2263)
> at org.apache.hadoop.hbase.regionserver.HRegion.get(HRegion.java:2252)
> at
> org.apache.hadoop.hbase.regionserver.HRegionServer.get(HRegionServer.java:1739)
> This can happen if your table only has deletes, and everything evaporates
> during a major compaction.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.