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

Anoop Sam John commented on HBASE-16696:
----------------------------------------

Understood the problem now.   So in case of catch block , after 16604, we will 
close this scanner.  We will not directly call close on RegionScanner. Instead 
we will add a close callback. This callback will be (any RpcCallback) will be 
called once the result of the request is RPCed.   But in finally there is a 
overwrite of the callback happens. In normal scan case we use Shipped callback. 
 Means the scanner is not yet done and closed. Only this batch of read is over. 
This callback will not close the RegionScanner but call shipped() method and 
throughout the stack.  The diff btw these 2 flows is that the close flow will 
release all the blocks read from L2 cache. Means ref count will get 
decremented.  Where as the shipped will not release the cur block.. Cur block 
might get used by next RPC on the scanner.   As the overwrite happened, the 
close flow is not getting called and so we miss return of the last block,  So 
decr count on last block is what missed.

Regarding the fix.  Does it make sense now to move the code in finally to be 
the last statements in the try block itself?  Because we have ex == null check 
now.  If any exception happened, we tend to not execute the code in finally 
block now.. Means we want only try to do this work.  
Also we might not need if (scanners.containsKey(scannerName))   this if check 
also.
I did not get the test code change fully.

> After HBASE-16604 - does not release blocks in case of scanner exception
> ------------------------------------------------------------------------
>
>                 Key: HBASE-16696
>                 URL: https://issues.apache.org/jira/browse/HBASE-16696
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: ramkrishna.s.vasudevan
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: HBASE-16696.patch, build-1638.out, build-1639.out
>
>
> TestBlockEvictionFromClient consistently fails in master branch.
> From existing Jenkins builds, looks like this started with build 1639.
> See attached Jenkins console logs.
> Pls refer to this comment 
> https://issues.apache.org/jira/secure/EditComment!default.jspa?id=13004009&commentId=15522451
> for the reason for the test failure.



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

Reply via email to