-
Notifications
You must be signed in to change notification settings - Fork 720
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
statistics: get region info via core cluster inside RegionStatistics #6804
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. |
82aa324
to
d472ccb
Compare
pkg/statistics/region_collection.go
Outdated
for _, r := range r.stats[typ] { | ||
res = append(res, r.RegionInfo.Clone()) | ||
for regionID := range r.stats[typ] { | ||
res = append(res, r.core.GetRegion(regionID).Clone()) |
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.
Do you need to check the region status that satisfy the required type?
for example , some region is down peer in the stats , but is healthy peer in th core.
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.
I think it's unnecessary since (*RegionStatistics).Observe
will be called right after the region info is updated in *core.RegionsInfo
, therefore according to the current code, there will be no inconsistency.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #6804 +/- ##
==========================================
+ Coverage 74.13% 74.26% +0.13%
==========================================
Files 413 413
Lines 43413 43304 -109
==========================================
- Hits 32183 32160 -23
+ Misses 8354 8285 -69
+ Partials 2876 2859 -17
Flags with carried forward coverage won't be shown. Click here to find out more. |
pkg/statistics/region_collection.go
Outdated
for _, r := range r.offlineStats[typ] { | ||
res = append(res, r.Clone()) | ||
for regionID := range r.offlineStats[typ] { | ||
res = append(res, r.core.GetRegion(regionID).Clone()) |
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.
Will it affect the heartbeat?
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.
Considering that it will only be manually called by HTTP API and pd-ctl
, I don't think it will affect the heartbeat too much.
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.
What if we have some stores that are offline and each of them has many regions?
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.
What about keeping the offline peer region recorded in the RegionStatistics
as before to gain better performance in this case?
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.
I changed this part of the logic to a mixture of old and new. PTAL.
1af975a
to
896d6d5
Compare
896d6d5
to
8a1360a
Compare
Signed-off-by: JmPotato <[email protected]>
Signed-off-by: JmPotato <[email protected]>
Signed-off-by: JmPotato <[email protected]>
Signed-off-by: JmPotato <[email protected]>
Signed-off-by: JmPotato <[email protected]>
Signed-off-by: JmPotato <[email protected]>
Signed-off-by: JmPotato <[email protected]>
/merge |
@JmPotato: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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. |
This pull request has been accepted and is ready to merge. Commit hash: b729f30
|
In response to a cherrypick label: new pull request created to branch |
close tikv#6560 Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
close tikv#6560 Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
close tikv#6560 Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
close tikv#6560 Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
close tikv#6560 Signed-off-by: ti-chi-bot <[email protected]>
…ikv#6804) close tikv#6560 Instead of maintaining its own region info cache, use the core cluster to fetch the region info inside `RegionStatistics` to make sure consistency. Signed-off-by: JmPotato <[email protected]>
What problem does this PR solve?
Issue Number: Close #6560.
What is changed and how does it work?
Check List
Tests
Run
pd-ctl region check miss-peer
:Run
pd-ctl region 22
:Release note