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

Thomas D'Silva commented on PHOENIX-4296:
-----------------------------------------

[~fengchen8086] Sorry for the delay in reviewing this. Thanks for fixing this. 
I just had two minor nits. Can you please have your test extend 
{{ParallelStatsDisabledIT}}?
and set the tableName using the generateUniqueName()

Also you can just set the SCAN_RESULT_CHUNK_SIZE to 2 in the client side 
properties:
{code}
Properties props = new Properties();
        props.setProperty(QueryServices.SCAN_RESULT_CHUNK_SIZE, "2");
Connection conn = DriverManager
       .getConnection(PHOENIX_JDBC_URL, props);

String sql = "SELECT A, B FROM " + tableName + " ORDER BY A DESC";
        PhoenixStatement stmt = 
conn.createStatement().unwrap(PhoenixStatement.class);
        ResultSet rs = stmt.executeQuery(sql);

        QueryPlan plan = stmt.getQueryPlan();
{code}                

Other than that LGTM, can you please upload a patch with these changes and I 
will get this included in 4.14.2.

> Dead loop in HBase reverse scan when amount of scan data is greater than 
> SCAN_RESULT_CHUNK_SIZE
> -----------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-4296
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4296
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.6.0
>            Reporter: rukawakang
>            Assignee: Chen Feng
>            Priority: Major
>             Fix For: 4.14.2
>
>         Attachments: PHOENIX-4296-4.x-HBase-1.2-v2.patch, 
> PHOENIX-4296-4.x-HBase-1.2-v3.patch, PHOENIX-4296-4.x-HBase-1.2.patch, 
> PHOENIX-4296.patch
>
>
> This problem seems to only occur with reverse scan not forward scan. When 
> amount of scan data is greater than SCAN_RESULT_CHUNK_SIZE(default 2999), 
> Class ChunkedResultIteratorFactory will multiple calls function 
> getResultIterator. But in function getResultIterator it always readjusts 
> startRow, in fact, if in reverse scan we should readjust stopRow. For example 
> {code:java}
> if (ScanUtil.isReversed(scan)) {
>     scan.setStopRow(ByteUtil.copyKeyBytesIfNecessary(lastKey));
> } else {
>     scan.setStartRow(ByteUtil.copyKeyBytesIfNecessary(lastKey));
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to