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

schedule: prevent removing voters directly in 2 replica raft group #4564

Merged
merged 5 commits into from
Jan 13, 2022

Conversation

HunDunDM
Copy link
Member

What problem does this PR solve?

close #4411

What is changed and how it works?

Check List

Tests

  • Unit test

Code changes

Side effects

Related changes

Release note

Prevent removing a voter from 2 replicas raft group directly, instead, demote the voter firstly.

close tikv#4411

Signed-off-by: HunDunDM <hundundm@gmail.com>
Signed-off-by: HunDunDM <hundundm@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 12, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lhy1024
  • nolouch

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jan 12, 2022
@ti-chi-bot ti-chi-bot requested a review from nolouch January 12, 2022 08:30
@HunDunDM HunDunDM added the component/schedule Scheduling logic. label Jan 12, 2022
Signed-off-by: HunDunDM <hundundm@gmail.com>
@HunDunDM HunDunDM requested a review from disksing January 12, 2022 08:39
@codecov
Copy link

codecov bot commented Jan 12, 2022

Codecov Report

Merging #4564 (2788c41) into master (777cd89) will increase coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4564      +/-   ##
==========================================
+ Coverage   74.83%   74.93%   +0.10%     
==========================================
  Files         265      265              
  Lines       27899    27900       +1     
==========================================
+ Hits        20877    20908      +31     
+ Misses       5148     5133      -15     
+ Partials     1874     1859      -15     
Flag Coverage Δ
unittests 74.93% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/schedule/operator/builder.go 86.75% <100.00%> (+0.42%) ⬆️
pkg/dashboard/adapter/manager.go 79.78% <0.00%> (-3.20%) ⬇️
pkg/etcdutil/etcdutil.go 82.35% <0.00%> (-2.36%) ⬇️
server/member/member.go 64.70% <0.00%> (-2.14%) ⬇️
server/election/leadership.go 75.25% <0.00%> (-2.07%) ⬇️
server/region_syncer/client.go 83.59% <0.00%> (-1.57%) ⬇️
server/schedule/operator_controller.go 82.92% <0.00%> (-1.22%) ⬇️
server/tso/global_allocator.go 60.84% <0.00%> (-1.06%) ⬇️
pkg/btree/btree.go 85.78% <0.00%> (-0.97%) ⬇️
tools/pd-ctl/pdctl/command/hot_command.go 71.03% <0.00%> (-0.69%) ⬇️
... and 15 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 777cd89...2788c41. Read the comment docs.

server/schedule/operator/builder_test.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 13, 2022
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

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jan 13, 2022
@nolouch
Copy link
Contributor

nolouch commented Jan 13, 2022

/merge

@ti-chi-bot
Copy link
Member

@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.

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 13, 2022
@ti-chi-bot
Copy link
Member

@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

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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
Copy link
Member Author

/merge cancel

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jan 13, 2022
Signed-off-by: HunDunDM <hundundm@gmail.com>
@HunDunDM
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

@HunDunDM: 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.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 2788c41

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 13, 2022
@ti-chi-bot ti-chi-bot merged commit 1279d55 into tikv:master Jan 13, 2022
@HunDunDM HunDunDM deleted the fix-4411 branch January 13, 2022 10:29
disksing pushed a commit to oh-my-tidb/pd that referenced this pull request Feb 8, 2022
…ikv#4564)

* schedule: prevent removing voters directly in 2 replica raft group

close tikv#4411

Signed-off-by: HunDunDM <hundundm@gmail.com>

* fix test

Signed-off-by: HunDunDM <hundundm@gmail.com>

* add test

Signed-off-by: HunDunDM <hundundm@gmail.com>

* add name

Signed-off-by: HunDunDM <hundundm@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/schedule Scheduling logic. release-note Denotes a PR that will be considered when it comes time to generate release notes. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing voter from 2 voter replicas raft group would make region unavailable
4 participants