Skip to content

*: fix the issue that loadcluster does not remove overlap regions#2022

Merged
sre-bot merged 9 commits into
tikv:masterfrom
nolouch:fix-loadcluster
Dec 17, 2019
Merged

*: fix the issue that loadcluster does not remove overlap regions#2022
sre-bot merged 9 commits into
tikv:masterfrom
nolouch:fix-loadcluster

Conversation

@nolouch

@nolouch nolouch commented Dec 15, 2019

Copy link
Copy Markdown
Contributor

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

@rleungx rleungx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread server/core/region.go
func (r *RegionInfo) GetMeta() *metapb.Region {
if r == nil {
return nil
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why need this?

@nolouch nolouch Dec 16, 2019

Copy link
Copy Markdown
Contributor Author

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

nolouch commented Dec 16, 2019

Copy link
Copy Markdown
Contributor Author

/run-all-tests

@lhy1024 lhy1024 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread server/cluster/cluster.go Outdated
err = rc.HandleRegionHeartbeat(region)
c.Assert(err, IsNil)
}
// merge case

Copy link
Copy Markdown
Member

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

codecov-io commented Dec 16, 2019

Copy link
Copy Markdown

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.

Comment thread tests/server/region_syncer/region_syncer_test.go
Signed-off-by: nolouch <nolouch@gmail.com>
@nolouch

nolouch commented Dec 17, 2019

Copy link
Copy Markdown
Contributor Author

/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

sre-bot commented Dec 17, 2019

Copy link
Copy Markdown
Contributor

/run-all-tests

@sre-bot

sre-bot commented Dec 17, 2019

Copy link
Copy Markdown
Contributor

@nolouch merge failed.

@nolouch

nolouch commented Dec 17, 2019

Copy link
Copy Markdown
Contributor Author

/merge

@sre-bot

sre-bot commented Dec 17, 2019

Copy link
Copy Markdown
Contributor

/run-all-tests

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

sre-bot commented Dec 17, 2019

Copy link
Copy Markdown
Contributor

cherry pick to release-3.0 failed

@sre-bot

sre-bot commented Dec 17, 2019

Copy link
Copy Markdown
Contributor

cherry pick to release-3.1 failed

@nolouch
nolouch deleted the fix-loadcluster branch December 17, 2019 08:57
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