Skip to content
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 9 commits into from
Dec 17, 2019

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Dec 15, 2019

Signed-off-by: nolouch nolouch@gmail.com

What problem does this PR solve?

fix #2011

What is changed and how it works?

check the region epoch firstly.

Check List

Tests

  • Unit test

Signed-off-by: nolouch <nolouch@gmail.com>
@lhy1024 lhy1024 added the type/bug The issue is confirmed as a bug. label Dec 16, 2019
Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -304,6 +304,9 @@ func (r *RegionInfo) GetID() uint64 {

// GetMeta returns the meta information of the region.
func (r *RegionInfo) GetMeta() *metapb.Region {
if r == nil {
return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need this?

Copy link
Contributor Author

@nolouch nolouch Dec 16, 2019

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.

@nolouch nolouch added needs-cherry-pick-release-3.0 The PR needs to cherry pick to release-3.0 branch. needs-cherry-pick-release-3.1 The PR needs to cherry pick to release-3.1 branch. labels Dec 16, 2019
@nolouch
Copy link
Contributor Author

nolouch commented Dec 16, 2019

/run-all-tests

Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

server/cluster/cluster.go Outdated Show resolved Hide resolved
@@ -94,6 +94,13 @@ func (s *serverTestSuite) TestRegionSyncer(c *C) {
err = rc.HandleRegionHeartbeat(region)
c.Assert(err, IsNil)
}
// merge case
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to add test with different merge order and epoch?

Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
@codecov-io
Copy link

codecov-io commented Dec 16, 2019

Codecov Report

Merging #2022 into master will decrease coverage by 0.01%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2022      +/-   ##
==========================================
- Coverage   77.35%   77.33%   -0.02%     
==========================================
  Files         180      180              
  Lines       18109    18128      +19     
==========================================
+ Hits        14008    14020      +12     
- Misses       3035     3038       +3     
- Partials     1066     1070       +4
Impacted Files Coverage Δ
server/core/errors.go 62.5% <100%> (+12.5%) ⬆️
server/core/region.go 91.53% <100%> (+0.03%) ⬆️
server/core/basic_cluster.go 89.17% <86.66%> (-2.45%) ⬇️
server/cluster/cluster.go 80.94% <90.9%> (ø) ⬆️
server/region_syncer/client.go 78.94% <0%> (-3.95%) ⬇️
server/member/leader.go 76.53% <0%> (-3.58%) ⬇️
pkg/metricutil/metricutil.go 96.87% <0%> (-3.13%) ⬇️
pkg/etcdutil/etcdutil.go 88.4% <0%> (-2.9%) ⬇️
client/client.go 70.9% <0%> (-1.23%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54974eb...ff979ad. Read the comment docs.

Signed-off-by: nolouch <nolouch@gmail.com>
@nolouch
Copy link
Contributor Author

nolouch commented Dec 17, 2019

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 17, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

@nolouch merge failed.

@nolouch
Copy link
Contributor Author

nolouch commented Dec 17, 2019

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

/run-all-tests

@sre-bot sre-bot merged commit 8198108 into tikv:master Dec 17, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

cherry pick to release-3.0 failed

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

cherry pick to release-3.1 failed

@nolouch nolouch deleted the fix-loadcluster branch December 17, 2019 08:57
Huster-ljw pushed a commit to Huster-ljw/pd that referenced this pull request Dec 18, 2019
nolouch added a commit to nolouch/pd that referenced this pull request Dec 18, 2019
nolouch added a commit to nolouch/pd that referenced this pull request Dec 18, 2019
nolouch added a commit to nolouch/pd that referenced this pull request Dec 18, 2019
sre-bot pushed a commit to sre-bot/pd that referenced this pull request Dec 19, 2019
sre-bot added a commit that referenced this pull request Dec 19, 2019
@AndreMouche AndreMouche added this to the v3.0.8 milestone Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-3.0 The PR needs to cherry pick to release-3.0 branch. needs-cherry-pick-release-3.1 The PR needs to cherry pick to release-3.1 branch. status/can-merge Indicates a PR has been approved by a committer. type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LoadRegion from persistent storage should remove overlap region after compare version
7 participants