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
tidb_load_based_replica_read_threshold may violate linearizability in point get scenario #43583
Comments
@overvenus If async-commit or 1PC protocol is used, just consider 1PC for simplicity. If So theoretically, there should be no linearizability violation, but I've not written a test case on tikv to verify this, it seems to be worth adding such test cases. |
IIRC, a point get with ts u64::MAX skips lock, so it can read |
For the autocommit point get, the
It looks a long existing problem for the follower-read feature. |
I think we need to add some caveats on document, since the feature is enable by default, does it mean that TiDB no longer guarantee linearizability in the autocommit point get scenario? |
To make follower-read and autocommit point get compatible, use leader read only for autocommit point get. |
This may not be a good solution as it may cause read hotspot issues for older clusters upgraded to the latest version. |
Close this by creating another issue in tikv tikv/tikv#14715. |
Bug Report
tidb_load_based_replica_read_threshold
allows tidb to read on follower when leader is busy.It may violate linearizability in point get scenario as the diagram shows.
A writes k to 9, B is concurrent to A and reads 9 on follower, C is concurrent to A and happens
after B but reads 8. It is possible when follower applies faster than leader.
1. Minimal reproduce step (Required)
Run Jepsen tests and inject some errors that cause TiKV busy.
It hard to reproduce in real world though.
2. What did you expect to see? (Required)
Does not violate linearizability.
3. What did you see instead (Required)
May violate linearizability.
4. What is your TiDB version? (Required)
v7.1.0
The text was updated successfully, but these errors were encountered: