raftstore: reset region approximate size/keys stats when it becomes leader#19181
raftstore: reset region approximate size/keys stats when it becomes leader#19181ti-chi-bot[bot] merged 3 commits intotikv:masterfrom
Conversation
Signed-off-by: glorv <glorvs@163.com>
Signed-off-by: glorv <glorvs@163.com>
| .pd_client | ||
| .get_region_approximate_size(region_id) | ||
| .unwrap_or_default(); | ||
| assert_eq!(size, 0); |
There was a problem hiding this comment.
It's technically possible to let the test pd-client ignore the 0 value as well, right? If we do that, we will be able to assert size >= 2000 in the end. But we will need to ensure that the new leader has uploaded its heartbeat (possibily using a failpoint).
There was a problem hiding this comment.
+1. we can add an assertion for the final state (size >= 2000).
| .pd_client | ||
| .get_region_approximate_size(region_id) | ||
| .unwrap_or_default(); | ||
| assert_eq!(size, 0); |
There was a problem hiding this comment.
+1. we can add an assertion for the final state (size >= 2000).
|
@hbisheng PTAL again, thanks |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: glorv, hbisheng, hhwyt The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
/hold |
|
/unhold |
|
/retest |
|
/test pull-unit-test |
|
/retest |
|
In response to a cherrypick label: new pull request created to branch |
|
In response to a cherrypick label: new pull request created to branch |
…eader (tikv#19181) close tikv#19180 Reset region's approximate size/keys stats when peer becomes leader. This can avoid peer report outdated stats to pd and caused unnecessary balance scheduling. Signed-off-by: glorv <glorvs@163.com>
What is changed and how it works?
Issue Number: Close #19180
What's Changed:
Related changes
pingcap/docs/pingcap/docs-cn:Check List
Tests
Side effects
Release note