phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen Feng (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-4296) Dead loop in HBase reverse scan when amount of scan data is greater than SCAN_RESULT_CHUNK_SIZE
Date Wed, 18 Oct 2017 09:00:02 GMT

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

Chen Feng commented on PHOENIX-4296:
------------------------------------

For example, if there are 3001 rows, whose ids are  [1, 2, 3, ..., 3001].
In the first scan with scan.startRow=1, stopRow=3001, since it is a reverse scan, the lastKey
will be 3001, 3000, 2999, ... 3.
At the end of the first scan, lastKey will be 2. 

In the next scan, the code    scan.setStartRow(ByteUtil.copyKeyBytesIfNecessary(lastKey));
        will set the scan with scan.startRow=2, stopRow=3001.

Therefore, the outer scan never ends with internal scans with repeated rows from 3 to 3001.


> 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
>
> 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
(v6.4.14#64029)

Mime
View raw message