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

Phil Yang edited comment on HBASE-18042 at 5/16/17 8:17 AM:
------------------------------------------------------------

I think even when we don't have {{more_results_in_region}} flag (before 
HBASE-13262 ), when the client scanner "thinks" this region is done, it will 
call possiblyNextScanner to close current scanner and open a new scanner in 
next region? 
{code:title=ClientScanner.java}
while (remainingResultSize > 0 && countdown > 0 && (!partialResults.isEmpty() 
|| possiblyNextScanner(countdown, values == null)));
{code}
But it is ok to get any exception while closing a scanner because the 
ClientScanner will catch any exception from server in close().
I am not sure if the current implementation in 0.98-1.2 will close the scanner 
correctly, but I think it is by designed that client should have some logic to 
judge if we are done for a region and prevent send another next rpc to the 
region, just send close rpc? The different from 1.2 to 1.3 is in 1.3 we just 
close the scanner at server directly and don't need the close rpc from client.


was (Author: yangzhe1991):
I think even when we don't have {{more_results_in_region}} flag (before 
HBASE-13262 ), when the client scanner "thinks" this region is done, it will 
call possiblyNextScanner to close current scanner and open a new scanner in 
next region? 
{code title=ClientScanner.java}

while (remainingResultSize > 0 && countdown > 0 && (!partialResults.isEmpty() 
|| possiblyNextScanner(countdown, values == null)));

{code}
But it is ok to get any exception while closing a scanner because the 
ClientScanner will catch any exception from server in close().
I am not sure if the current implementation in 0.98-1.2 will close the scanner 
correctly, but I think it is by designed that client should have some logic to 
judge if we are done for a region and prevent send another next rpc to the 
region, just send close rpc? The different from 1.2 to 1.3 is in 1.3 we just 
close the scanner at server directly and don't need the close rpc from client.

> Client Compatibility breaks between versions 1.2 and 1.3
> --------------------------------------------------------
>
>                 Key: HBASE-18042
>                 URL: https://issues.apache.org/jira/browse/HBASE-18042
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>            Reporter: Karan Mehta
>            Assignee: Karan Mehta
>
> OpenTSDB uses AsyncHBase as its client, rather than using the traditional 
> HBase Client. From version 1.2 to 1.3, the {{ClientProtos}} have been 
> changed. Newer fields are added to {{ScanResponse}} proto.
> For a typical Scan request in 1.2, would require caller to make an 
> OpenScanner Request, GetNextRows Request and a CloseScanner Request, based on 
> {{more_rows}} boolean field in the {{ScanResponse}} proto.
> However, from 1.3, new parameter {{more_results_in_region}} was added, which 
> limits the results per region. Therefore the client has to now manage sending 
> all the requests for each region. Further more, if the results are exhausted 
> from a particular region, the {{ScanResponse}} will set 
> {{more_results_in_region}} to false, but {{more_results}} can still be true. 
> Whenever the former is set to false, the {{RegionScanner}} will also be 
> closed. 
> OpenTSDB makes an OpenScanner Request and receives all its results in the 
> first {{ScanResponse}} itself, thus creating a condition as described in 
> above paragraph. Since {{more_rows}} is true, it will proceed to send next 
> request at which point the {{RSRpcServices}} will throw 
> {{UnknownScannerException}}. The protobuf client compatibility is maintained 
> but expected behavior is modified.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to