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

rule checker: try to remove orphan peer after fix rule peers #2546

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

disksing
Copy link
Contributor

Signed-off-by: disksing i@disksing.com

What problem does this PR solve?

Fix #2419

What is changed and how it works?

  • always try to remove orphan peers, even if failed to replace down/offline peer
  • add restriction to remove orphan peer, it only be checked when all rules are satisfied (to avoid too small replica count)

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)
1. start cluster with 4 tikv (A, B, C, D)
2. enable placement rules, set rules to 3voters+1learner
3. the region becomes voter(A) + voter(B) + voter(C) + learner(D)
4. set C to offline
5. remove the learner rule
6. make sure region becomes voeter(A) + voter(B) + voter(D)
7. check PD's log, operator history is `remove D + replace C with D`

Related changes

  • Need to cherry-pick to the release branch

Release note

  • fix the placement rules issue that prevent store changing to tombstone

Signed-off-by: disksing <i@disksing.com>
@disksing disksing added needs-cherry-pick-release-3.1 The PR needs to cherry pick to release-3.1 branch. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. component/placement Placement rule. labels Jun 17, 2020
@codecov-commenter
Copy link

Codecov Report

Merging #2546 into master will increase coverage by 0.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2546      +/-   ##
==========================================
+ Coverage   77.11%   77.26%   +0.15%     
==========================================
  Files         204      204              
  Lines       22067    22071       +4     
==========================================
+ Hits        17016    17053      +37     
+ Misses       3771     3740      -31     
+ Partials     1280     1278       -2     
Impacted Files Coverage Δ
server/schedule/checker/rule_checker.go 82.14% <100.00%> (+5.92%) ⬆️
pkg/metricutil/metricutil.go 86.11% <0.00%> (-5.56%) ⬇️
server/region_syncer/client.go 79.38% <0.00%> (-5.35%) ⬇️
pkg/etcdutil/etcdutil.go 82.60% <0.00%> (-1.45%) ⬇️
server/core/storage.go 74.38% <0.00%> (-0.83%) ⬇️
server/tso/tso.go 83.21% <0.00%> (-0.73%) ⬇️
server/server.go 76.48% <0.00%> (-0.46%) ⬇️
server/cluster/cluster.go 79.93% <0.00%> (-0.43%) ⬇️
server/grpc_service.go 59.96% <0.00%> (-0.20%) ⬇️
server/schedule/operator_controller.go 78.69% <0.00%> (+0.16%) ⬆️
... and 9 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 33bf660...2eed7ec. Read the comment docs.

@nolouch nolouch requested review from nolouch and HunDunDM June 17, 2020 17:02
@nolouch nolouch added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Jun 17, 2020
@nolouch nolouch added this to the v4.0.2 milestone Jun 18, 2020
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

lgtm

@HunDunDM HunDunDM removed this from the v4.0.2 milestone Jun 18, 2020
@HunDunDM HunDunDM removed the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Jun 18, 2020
@nolouch
Copy link
Contributor

nolouch commented Jun 18, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 18, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

cherry pick to release-3.1 in PR #2553

@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #2554

@disksing disksing deleted the remove-orphana branch June 18, 2020 12:01
Copy link
Member

@HunDunDM HunDunDM left a comment

Choose a reason for hiding this comment

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

LGTM

ti-srebot added a commit that referenced this pull request Jun 18, 2020
ti-srebot added a commit that referenced this pull request Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/placement Placement rule. needs-cherry-pick-release-3.1 The PR needs to cherry pick to release-3.1 branch. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

placement rule does not try to promote learner to voter to match rules
6 participants