-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
May receive multiple rows in streaming mode #12131
Comments
After some investigation, if a streaming response returning by TiKV meeting a lock error, it does not contain the We have two options to fix,
@mapleFU @breeswish PTAL. |
@SunRunAway We Intend to choose method1 as the solving method. Method 2 needs to change the streaming request logic in TiDB. And we think method 1 is better. |
Great, and I'll add a strict check to make sure each streaming response does contain a |
@SunRunAway Note that the last success streaming response may not contain a range (since it is useless) |
Could this be possible to have one? |
@SunRunAway We can attach one, but I wonder why it's necessary. And it may reduce the performance. |
@breeswish In if record_cnt > 0 {
let range = self.executor.take_scanned_range();
return self
.make_stream_response(chunk)
.map(|r| (Some((r, range)), finished));
}
Ok((None, true)) Seems that if there is any data, we will return the range here. If there is no data left, we just return EOF. |
@mapleFU You can have a try. I may have an incorrect memory. |
In TiKV, not all requests can be attached with range. If no range returned. Please use last received range and timestamp to send a request. If thats the first request, please send with the time and range again. @SunRunAway @breeswish |
Bravo |
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
When tidb open streaming mode in pr10949 , we may receive multiple rows in TiDB.
When we prepare enviroment:
And run the SQL below for multiple times:
SELECT * FROM t2 WHERE c = 10 ORDER BY a DESC, b DESC;
May return the response below:Here it returns multiple times of rows(expect 5, may get 10, 15 or more).
tidb-server -V
or runselect tidb_version();
on TiDB)?In pr 11949. @SunRunAway
The text was updated successfully, but these errors were encountered: