-
Notifications
You must be signed in to change notification settings - Fork 6k
planner: tolerate reasonable time lag between different TiDB nodes when updating binding cache (#64289) #64353
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
base: release-7.5
Are you sure you want to change the base?
planner: tolerate reasonable time lag between different TiDB nodes when updating binding cache (#64289) #64353
Conversation
Signed-off-by: ti-chi-bot <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@qw4990 This PR has conflicts, I have hold it. |
|
@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
@ti-chi-bot: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is an automated cherry-pick of #64289
What problem does this PR solve?
Issue Number: close #64250
Problem Summary: planner: tolerate reasonable time lag between different TiDB nodes when updating binding cache
What changed and how does it work?
When updating binding cache, TiDB doesn't consider time lag between different nodes, which could cause inconsistency on binding cache. See more info in #64250.
Below is an simplified example, TiDB1's clock is consistent with the real time, while TiDB2's clock is 0.5s slower than the real time:
mysql.bind_infowith timestamp00:00:30.200000mysql.bind_infowherebinding.update_time > LAST_UPDATE_TIME, 2) setLAST_UPDATE_TIMEto the latestbinding.update_time, in this case its00:00:30.20000000:00:30.000000due to system lock issueIn the case above, TiDB1 can never see the binding created by TiDB2 with timestamp
00:00:30.000000because itsLAST_UPDATE_TIME = 00:00:30.200000is larger than that binding's timestamp.The solution is simple, set a tolerance interval (10s by default) when updating binding cache. And it's safe to load duplicated bindings, because we'll deduplicate them before actually putting them into the cache.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.