Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix count error, if advanceNextResponse is empty, we should read next region #878

Merged
merged 5 commits into from
Jul 1, 2019
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,25 @@ private boolean advanceNextResponse() {
return true;
}

/**
* chunk maybe empty while there is still data transmitting from TiKV. In this case, {@code
* readNextRegionChunks} cannot just returns false because the iterator thinks there is no data to
* process. This while loop ensures we can drain all possible data transmitting from TiKV.
*
* @return
*/
private boolean readNextRegionChunks() {
if (eof || regionTasks == null || taskIndex >= regionTasks.size()) {
return false;
while (true) {
if (eof || regionTasks == null || taskIndex >= regionTasks.size()) {
return false;
}
if (doReadNextRegionChunks()) {
return true;
}
}
}

private boolean doReadNextRegionChunks() {
try {
switch (pushDownType) {
case STREAMING:
Expand Down