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

operator: remove empty JointConsensus steps and fix single voter demote bug (#4534) #4552

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #4534

Signed-off-by: Hua Lu hua.lu@pingcap.com

What problem does this PR solve?

Closes: #4362
Closes: #4444

What is changed and how it works?

  • Modify condition to enable useJointConsensus when there is only single non-demote peer change
  • Add logic in execChangePeerV2 to prevent generate empty enter / leave JointConsensus steps
  • Remove allowDemote and DemoteFollower step

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Release note

- fix a bug that operate steps may contain unnecessary or empty JointConsensus steps in certain conditions 
- fix a bug when demoting single voter directly

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member Author

ti-chi-bot commented Jan 6, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • HunDunDM
  • JmPotato

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 release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/cherry-pick-not-approved labels Jan 6, 2022
@ti-chi-bot ti-chi-bot added the type/cherry-pick-for-release-5.3 The PR belongs to release-5.3 cherry pick. label Jan 6, 2022
Signed-off-by: HunDunDM <hundundm@gmail.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 6, 2022
@codecov
Copy link

codecov bot commented Jan 6, 2022

Codecov Report

Merging #4552 (d2aa67b) into release-5.3 (aec8fd9) will decrease coverage by 0.21%.
The diff coverage is 88.88%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-5.3    #4552      +/-   ##
===============================================
- Coverage        75.04%   74.82%   -0.22%     
===============================================
  Files              264      264              
  Lines            27296    27278      -18     
===============================================
- Hits             20484    20412      -72     
- Misses            5011     5049      +38     
- Partials          1801     1817      +16     
Flag Coverage Δ
unittests 74.82% <88.88%> (-0.22%) ⬇️

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

Impacted Files Coverage Δ
server/schedule/operator/step.go 71.87% <ø> (-1.19%) ⬇️
server/schedule/operator/builder.go 86.46% <88.23%> (-2.85%) ⬇️
server/schedule/operator_controller.go 83.84% <100.00%> (-0.89%) ⬇️
pkg/errs/errs.go 75.00% <0.00%> (-25.00%) ⬇️
pkg/tempurl/tempurl.go 45.00% <0.00%> (-15.00%) ⬇️
server/kv/etcd_kv.go 69.56% <0.00%> (-10.15%) ⬇️
server/tso/tso.go 59.09% <0.00%> (-7.96%) ⬇️
server/region_syncer/client.go 79.68% <0.00%> (-3.91%) ⬇️
pkg/etcdutil/etcdutil.go 84.70% <0.00%> (-3.53%) ⬇️
... and 13 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 57c9c2e...d2aa67b. Read the comment docs.

@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 6, 2022
@VelocityLight VelocityLight added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Feb 21, 2022
@nolouch
Copy link
Contributor

nolouch commented Feb 21, 2022

/merge

@ti-chi-bot
Copy link
Member Author

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

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

Commit hash: eb19c1d

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

@ti-chi-bot: 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.

@ti-chi-bot ti-chi-bot merged commit 00a625f into tikv:release-5.3 Feb 21, 2022
@purelind purelind added this to the v5.3.1 milestone Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. 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. type/cherry-pick-for-release-5.3 The PR belongs to release-5.3 cherry pick.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants