-
Notifications
You must be signed in to change notification settings - Fork 719
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
checker: prevent the regions in split-cache from becoming the target of merge #3454
Conversation
…of merge Signed-off-by: HunDunDM <hundundm@gmail.com>
Signed-off-by: HunDunDM <hundundm@gmail.com>
Originally, a unittest tested this bug, but due to many problems in the test code, the unittest failed to detect the bug. |
@@ -122,8 +122,8 @@ func (s *testMergeCheckerSuite) SetUpTest(c *C) { | |||
}, | |||
}, | |||
&metapb.Peer{Id: 109, StoreId: 4}, | |||
core.SetApproximateSize(10), | |||
core.SetApproximateKeys(10), | |||
core.SetApproximateSize(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.
Here, the original value 10 is greater than threshold 2, which causes the region to be unable to be merged.
@@ -191,10 +191,19 @@ func (s *testMergeCheckerSuite) TestBasic(c *C) { | |||
c.Assert(ops, NotNil) | |||
c.Assert(ops[0].RegionID(), Equals, s.regions[2].GetID()) | |||
c.Assert(ops[1].RegionID(), Equals, s.regions[1].GetID()) | |||
s.cluster.RuleManager.DeleteRule("test", "test") | |||
s.cluster.RuleManager.DeleteRule("pd", "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.
The rule was not deleted correctly here, which caused the subsequent test to be invalid.
ops = s.mc.Check(s.regions[2]) | ||
c.Assert(ops, IsNil) | ||
|
||
s.mc.startTime = time.Now().Add(-2 * time.Hour) |
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.
The original test did not modify the startTime
. Due to the following code logic, all regions cannot be merged.
expireTime := m.startTime.Add(m.opts.GetSplitMergeInterval())
if time.Now().Before(expireTime) {
checkerCounter.WithLabelValues("merge_checker", "recently-start").Inc()
return nil
}
Codecov Report
@@ Coverage Diff @@
## master #3454 +/- ##
==========================================
- Coverage 75.00% 74.87% -0.13%
==========================================
Files 244 244
Lines 23556 23557 +1
==========================================
- Hits 17667 17638 -29
- Misses 4311 4331 +20
- Partials 1578 1588 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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
[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 writing |
/merge |
@Yisaer: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests 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: c1c1e95
|
/merge |
@lhy1024: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests 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. |
@HunDunDM: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests 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. |
/run-integration-ddl-test |
1 similar comment
/run-integration-ddl-test |
/run-integration-ddl-test |
/run-integration-lightning-test |
I think maybe this CI broken. |
Or only "run-all-tests" can trigger it. |
/run-all-tests |
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests 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. |
/run-integration-ddl-test |
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests 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. |
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests 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. |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-3.0 in PR #3458 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #3459 |
…of merge (#3454) (#3458) * cherry pick #3454 to release-3.0 Signed-off-by: ti-srebot <ti-srebot@pingcap.com> * revert Signed-off-by: HunDunDM <hundundm@gmail.com> * pick Signed-off-by: HunDunDM <hundundm@gmail.com> Co-authored-by: 混沌DM <hundundm@gmail.com> Co-authored-by: Ti Chi Robot <71242396+ti-chi-bot@users.noreply.github.com>
What problem does this PR solve?
What is changed and how it works?
Check List
Tests
Related changes
Release note