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

ASF subversion and git services commented on KUDU-1260:
-------------------------------------------------------

Commit 345fce81aa52fa378a57d6b610d42e751a1387a4 in kudu's branch 
refs/heads/master from Hongjiang Zhang
[ https://gitbox.apache.org/repos/asf?p=kudu.git;h=345fce8 ]

KUDU-1260: Fix prefetching bug on Java scanner

Add a UT to test prefetching. The UT has two concurrent threads: writing
thread and scanner thread. The writing thread records the timestamp of
its write, and the scanner thread creates two scanners (w and w/o prefetching),
by comparing the scan result of the two scanners, we can verify the
prefetching result.

When prefetching is enabled, there is a RowResultIterator prefetched and
it will override the one which has not yet been consumed in current
implementation, as a result, some data will loss. The fix is simple:
use an atomic reference to cache the result and avoid value overriding.

Furthermore, there are at most two concurrent ScanRequests
sent to the tserver. But if the scan data reached the end, only one 
hasMore=false is returned.
As a result, one of the ScanRequests got "scanner not found (it may have 
expired)" exception.
The same issue occurs for KeepAliveRequest. This patch also addressed this 
issue.

Change-Id: I853a041d86c75ec196d7d4ff45af4673c5c5f5cd
Reviewed-on: http://gerrit.cloudera.org:8080/17773
Tested-by: Kudu Jenkins
Reviewed-by: Andrew Wong <[email protected]>


> Add a test for prefetching on java scanner
> ------------------------------------------
>
>                 Key: KUDU-1260
>                 URL: https://issues.apache.org/jira/browse/KUDU-1260
>             Project: Kudu
>          Issue Type: Test
>          Components: client, test
>    Affects Versions: Public beta
>            Reporter: David Alves
>            Priority: Major
>         Attachments: TestKuduScannerPrefetching.java
>
>
> We have a 'prefetching' feature in the java scanner which is not tested. We 
> should add a test for it.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to