-
Notifications
You must be signed in to change notification settings - Fork 719
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
tso: fix the bug that TSO request may fail at the time of leader changing #2665
Conversation
Signed-off-by: JmPotato <ghzpotato@gmail.com>
/run-all-tests |
/rebuild |
Signed-off-by: JmPotato <ghzpotato@gmail.com>
/run-all-tests |
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, do we need to add a related test case?
I tried to add a test case but it turned out that it's hard to simulate this situation accurately through unit test codes. |
@ti-srebot /merge |
@JmPotato No command or invalid command |
/merge |
/run-all-tests |
cherry pick to release-4.0 failed |
/run-cherry-picker |
cherry pick to release-4.0 failed |
/run-cherry-picker |
cherry pick to release-4.0 failed |
/run-cherry-picker |
cherry pick to release-4.0 failed |
/run-cherry-picker |
cherry pick to release-4.0 failed |
/run-cherry-picker |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #2666 |
Signed-off-by: JmPotato ghzpotato@gmail.com
Close #2663
What problem does this PR solve?
Under the current latest version of PD, TSO request may fail at the time of leader changing because
SyncTimestamp
is not yet completed but PD receives a TSO request at the same time.What is changed and how it works?
Add leader lease check and try to sleep a while to wait for
SyncTimestamp
.Check List
Tests
Code changes
GetRespTS
method changeRelated changes
Release note
Fix the bug that TSO request may fail at the time of leader changing.