[
https://issues.apache.org/jira/browse/HBASE-6900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470046#comment-13470046
]
ramkrishna.s.vasudevan commented on HBASE-6900:
-----------------------------------------------
@Lars
Its better if we get it in 0.94.2. I was once again checking the lastTop
behaviour. Even if two times updateReaders happen i feel the lastTop will not
be null. Verified the same with a testcase.
{code}
// All public synchronized API calls will call 'checkReseek' which will cause
// the scanner stack to reseek if this.heap==null && this.lastTop != null.
// But if two calls to updateReaders() happen without a 'next' or 'peek'
then we
// will end up calling this.peek() which would cause a reseek in the middle
of a updateReaders
// which is NOT what we want, not to mention could cause an NPE. So we
early out here.
if (this.heap == null) return;
{code}
So i feel the patch that you gave should be fine without additional checks. +1
on it.
Lars if you can commit that would be great because i cannot do the commit from
office and also i may not be able to do it today.
> RegionScanner.reseek() creates NPE when a flush or compaction happens before
> the reseek.
> ----------------------------------------------------------------------------------------
>
> Key: HBASE-6900
> URL: https://issues.apache.org/jira/browse/HBASE-6900
> Project: HBase
> Issue Type: Bug
> Reporter: ramkrishna.s.vasudevan
> Assignee: ramkrishna.s.vasudevan
> Fix For: 0.94.2, 0.96.0
>
> Attachments: 6900-test.txt, HBASE-6900_1.patch, HBASE-6900.patch
>
>
> HBASE-5520 introduced reseek() on the RegionScanner.
> Now when a scanner is created we have the StoreScanner heap. After this if a
> flush or compaction happens parallely all the StoreScannerObservers are
> cleared so that whenever a new next() call happens we tend to recreate the
> scanner based on the latest store files.
> The reseek() in StoreScanner expects the heap not to be null because always
> reseek would be called from next()
> {code}
> public synchronized boolean reseek(KeyValue kv) throws IOException {
> //Heap cannot be null, because this is only called from next() which
> //guarantees that heap will never be null before this call.
> if (explicitColumnQuery && lazySeekEnabledGlobally) {
> return heap.requestSeek(kv, true, useRowColBloom);
> } else {
> return heap.reseek(kv);
> }
> }
> {code}
> Now when we call RegionScanner.reseek() directly using CPs we tend to get a
> NPE. In our case it happened when a major compaction was going on. I will
> also attach a testcase to show the problem.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira