-
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
tikv: use timestamp from TSO instead of MaxVersion in point get retry #22789
Conversation
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
0f8b33d
to
26850a6
Compare
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
26850a6
to
5e9f196
Compare
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Is async-commit on? The reason why async commit has some regression using point get in high-conflict scenarios is it's more likely to be blocked by memory locks because they're written faster in memory than the raft store? |
Yes. This PR mitigates one of the regression causes. And my another PR tikv/tikv#9625 deals with the other one you mentioned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
What problem does this PR solve?
We use MaxVersion to read when doing an auto-commit point select. Such reads can be blocked by any secondary locks or async-commit locks for linearizability.
Before this PR, we try to resolve the lock and backoff before retry. However, these operations can be unnecessary. And in the worst cases, it is possible that the reader keeps meeting different locks after backoff, which increases latency a lot.
What is changed and how it works?
In this PR, before doing a point get with max version, we get a timestamp from the TSO asynchronously. If the point get meets a lock, we use the timestamp from the TSO to retry. It does not add latency if point get does not meet a lock while improving the worst cases.
Check List
Tests
Run two sysbench test concurrently:
So the point select will read the lock very often. Measure the QPS of point select:
Master: 5032.14
This PR: 8809.72
Release note