-
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
*: fix the issue that loadcluster does not remove overlap regions #2022
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
88641d0
*: fix the issue that loadcluster does not remove overlap regions
nolouch a442ce3
Merge branch 'master' into fix-loadcluster
nolouch de3d6f2
address comments
nolouch 4e18324
Merge remote-tracking branch 'nolouch/fix-loadcluster' into fix-loadc…
nolouch 8fb7e0f
fix ci
nolouch 62401c1
do not update pd-web
nolouch 375a57f
address comments
nolouch 46dd86a
Merge branch 'master' into fix-loadcluster
sre-bot ff979ad
Merge branch 'master' into fix-loadcluster
sre-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,29 @@ func (s *serverTestSuite) TestRegionSyncer(c *C) { | |
err = rc.HandleRegionHeartbeat(region) | ||
c.Assert(err, IsNil) | ||
} | ||
// merge case | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to add test with different merge order and epoch? |
||
// region2 -> region1 -> region0 | ||
// merge A to B will increases version to max(versionA, versionB)+1, but does not increase conver | ||
regions[0] = regions[0].Clone(core.WithEndKey(regions[2].GetEndKey()), core.WithIncVersion(), core.WithIncVersion()) | ||
err = rc.HandleRegionHeartbeat(regions[2]) | ||
c.Assert(err, IsNil) | ||
|
||
// merge case | ||
lhy1024 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// region3 -> region4 | ||
// merge A to B will increases version to max(versionA, versionB)+1, but does not increase conver | ||
regions[4] = regions[3].Clone(core.WithEndKey(regions[4].GetEndKey()), core.WithIncVersion()) | ||
err = rc.HandleRegionHeartbeat(regions[4]) | ||
c.Assert(err, IsNil) | ||
|
||
// merge case | ||
// region0 -> region4 | ||
// merge A to B will increases version to max(versionA, versionB)+1, but does not increase conver | ||
regions[4] = regions[0].Clone(core.WithEndKey(regions[4].GetEndKey()), core.WithIncVersion(), core.WithIncVersion()) | ||
err = rc.HandleRegionHeartbeat(regions[4]) | ||
c.Assert(err, IsNil) | ||
regions = regions[4:] | ||
regionLen = len(regions) | ||
|
||
// ensure flush to region storage, we use a duration larger than the | ||
// region storage flush rate limit (3s). | ||
time.Sleep(4 * time.Second) | ||
|
@@ -104,6 +127,9 @@ func (s *serverTestSuite) TestRegionSyncer(c *C) { | |
c.Assert(leaderServer, NotNil) | ||
loadRegions := leaderServer.GetServer().GetRaftCluster().GetRegions() | ||
c.Assert(len(loadRegions), Equals, regionLen) | ||
for _, region := range regions { | ||
c.Assert(leaderServer.GetRegionInfoByID(region.GetID()).GetMeta(), DeepEquals, region.GetMeta()) | ||
} | ||
} | ||
|
||
func (s *serverTestSuite) TestFullSyncWithAddMember(c *C) { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why need this?
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.
If not may panic in this line.