-
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
store/tikv: add sanity check for snapshot version and forUpdateTS #20159
Conversation
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
/rebuild |
/run-check-release-note |
But |
Agree. Another way is limiting the retry time to avoid stack overflow, but I'm afraid it'll lead to a great change. |
It's a particularly long time ago. I think we can add such a shelf life to TiDB. :) |
I'll try reproducing this first. |
Maybe we can treat all timestamps that greater than a certain value as invalid. |
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
I treat the snapshot with version >= MaxInt64 and not equal MaxUint64 as invalid, and check forUpdateTS to avoid too deep recursive. |
Signed-off-by: you06 <you1474600@gmail.com>
/run-all-tests |
Signed-off-by: you06 <you1474600@gmail.com>
/run-all-tests |
@disksing I add an extra check for the error response to avoid the infinite retry. |
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 |
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #20248 |
Signed-off-by: you06 you1474600@gmail.com
What problem does this PR solve?
Issue Number: #19887
Problem Summary:
The invalid startTS caused TiDB stack overflow in BR's test, but we didn't know where the invalid startTS comes from, this PR add sanity check for startTS == MaxInt64.
What is changed and how it works?
What's Changed: check startTS before txn commit.
How it Works: if the startTS is an invalid value, an error will be returned and we can find where it comes from by stack trace.
Related changes
Check List
Tests
No test is required for this change
Side effects
Release note