-
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
*: update client-go (tidb-6.1) #38414
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
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
ah, maybe need go mod tidy? |
Oops. Fixed. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 685d796631edea87e658a6695d4ad07280c801f1
|
/run-all-tests |
/hold |
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
685d796
to
8556719
Compare
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 8556719
|
/unhold |
What problem does this PR solve?
Issue Number: close #37141
Problem Summary:
Our region cache B-Tree uses the start key of the region as the entry key. So, insertRegionToCache only replaces the region with the same start key:
https://github.com/tikv/client-go/blob/516cfcdecce865d90ec05dd1cc1de060c35438dc/internal/locate/region_cache.go#L1287
Considering there's a table with lots of regions, the user removes all data from the table. So, PD will finally merge all regions into one. In our region cache implementation, only the first region (containing the table head) is updated, while all other regions still exist in the cache.
When we locate a key near the end of the table, DescendLessOrEqual will iterate over all regions that are left in the cache. This will waste a lot of CPU and make region search really slow, and it is also possible to cause lots of unnecessary PD loadRegion RPCs.
To solve the problem, when we do insertRegionToCache, we should iterate the B-Tree for all regions that intersect with the inserted region and remove them.
What is changed and how it works?
It includes tikv/client-go#566, so when new region info is inserted to the cache, old invalid region cache that will be cleared.
This also includes tikv/client-go#585, which covers more cases like #26832 to reduce the risk of data race of SelectLock executor under other parallel executors.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.