[
https://issues.apache.org/jira/browse/HBASE-5922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13269346#comment-13269346
]
Anoop Sam John commented on HBASE-5922:
---------------------------------------
@Nate
Thanks for the patch
Just one more thing which is wrong with the seekBefore() code
{code}
if (top) {
if (getComparator().compare(key, offset, length, splitkey, 0,
splitkey.length) < 0) {
return false;
}
}
{code}
This is the code for the special check with top file..When the passed key is <
splitKey return false as there wont be any key less than the midkey in this
file. Just because of this factor, we need to return false and should not do
any seek when the passed key is equal to splitKey, in case of top scanner...
I know this is out of interest of this bug as such.. But would be nice to fix
as part of this. Or need another JIRA?
One check in your test case also reveals this issue..
{code}
+ foundKeyValue = doTestOfSeekBefore(p, fs, top, midKV, cacheConf);
+ assertEquals(beforeMidKey, foundKeyValue);
{code}
In this try to seekBefore midKV in the top file and it returns beforeMidKey,
which is there in the bottom file !
{quote}
2. On the top half file a seekBefore() call with a key = splitkey is supposed
to return false but it wont happen. It will try to seek into the bottom half I
fear ..
{quote}
Yes the same thing is happening...
Good on you Nate and Johnson... The test case also try to cover all boundary
cases
One minor comment about the test case : Can we assert the return value of this
seekBefore() especially when the return value is false?
> HalfStoreFileReader seekBefore causes StackOverflowError
> --------------------------------------------------------
>
> Key: HBASE-5922
> URL: https://issues.apache.org/jira/browse/HBASE-5922
> Project: HBase
> Issue Type: Bug
> Components: client, io
> Affects Versions: 0.90.0
> Environment: HBase 0.90.4
> Reporter: Nate Putnam
> Assignee: Nate Putnam
> Priority: Critical
> Fix For: 0.90.0
>
> Attachments: HBASE-5922.patch, HBASE-5922.patch, HBASE-5922.v2.patch,
> HBASE-5922.v3.patch
>
>
> Calling HRegionServer.getClosestRowBefore() can cause a stack overflow if the
> underlying store file is a reference and the row key is in the bottom.
> java.io.IOException: java.io.IOException: java.lang.StackOverflowError
> at
> org.apache.hadoop.hbase.regionserver.HRegionServer.convertThrowableToIOE(HRegionServer.java:990)
> at
> org.apache.hadoop.hbase.regionserver.HRegionServer.convertThrowableToIOE(HRegionServer.java:978)
> at
> org.apache.hadoop.hbase.regionserver.HRegionServer.getClosestRowBefore(HRegionServer.java:1651)
> at sun.reflect.GeneratedMethodAccessor174.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
> at
> org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
> Caused by: java.lang.StackOverflowError
> at
> org.apache.hadoop.hbase.io.HalfStoreFileReader$1.seekBefore(HalfStoreFileReader.java:147)
> at
> org.apache.hadoop.hbase.io.HalfStoreFileReader$1.seekBefore(HalfStoreFileReader.java:149)
> at
> org.apache.hadoop.hbase.io.HalfStoreFileReader$1.seekBefore(HalfStoreFileReader.java:149)
> at
> org.apache.hadoop.hbase.io.HalfStoreFileReader$1.seekBefore(HalfStoreFileReader.java:149)
> at
> org.apache.hadoop.hbase.io.HalfStoreFileReader$1.seekBefore(HalfStoreFileReader.java:149)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira