-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
tikv: pre-index stores in region-cache for different access pattern #18040
Conversation
/run-all-tests |
@@ -381,10 +435,10 @@ func (c *RegionCache) GetTiFlashRPCContext(bo *Backoffer, id RegionVerID) (*RPCC | |||
|
|||
// sIdx is for load balance of TiFlash store. | |||
sIdx := int(atomic.AddInt32(®ionStore.workTiFlashIdx, 1)) |
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.
Is it possible that the workTiFlashIdx
increased to the length of the array, and is used to access the slice, then panic with slice out of bound error?
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.
workTiFlashIdx will continue increasing, but it always mod TiFlash store count
accessIdx := (sIdx + i) % regionStore.accessStoreNum(TiFlashOnly)
before access AccessIndex
array
Codecov Report
@@ Coverage Diff @@
## master #18040 +/- ##
================================================
+ Coverage 79.4486% 79.4636% +0.0149%
================================================
Files 525 525
Lines 142375 142396 +21
================================================
+ Hits 113115 113153 +38
+ Misses 20106 20079 -27
- Partials 9154 9164 +10 |
/run-all-tests |
1 similar comment
/run-all-tests |
LGTM |
@jackysp PTAL |
/run-all-tests |
/run-common-test |
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 |
/rebuild |
@lysu merge failed. |
/run-all-tests |
again, failed on
|
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #18105 |
/run-cherry-picker |
What problem does this PR solve?
Issue Number: close #17930
Problem Summary:
What is changed and how it works?
What's Changed, How it Works:
accessIndex
Related changes
Check List
Tests
Side effects
Release note
This change is