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

scale-in pd leader after evict the leader #2005

Merged
merged 8 commits into from
Aug 10, 2022

Conversation

3AceShowHand
Copy link
Contributor

@3AceShowHand 3AceShowHand commented Aug 4, 2022

What problem does this PR solve?

close #2015

This can help TiCDC be more robust to PD leader change, replication latency does not goes up, since there is always a pd leader to contact for make progress.

What is changed and how it works?

transfer the pd leadership, before scale-in pd leader node.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Code changes

Side effects

Related changes

Release notes:

NONE

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 4, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AstroProfundis

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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 4, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2022

Codecov Report

Merging #2005 (f97d910) into master (760643a) will decrease coverage by 11.70%.
The diff coverage is 58.82%.

❗ Current head f97d910 differs from pull request most recent head 5dda5cf. Consider uploading reports for the commit 5dda5cf to get more accurate results

@@             Coverage Diff             @@
##           master    #2005       +/-   ##
===========================================
- Coverage   52.61%   40.91%   -11.70%     
===========================================
  Files         308      288       -20     
  Lines       35878    33507     -2371     
===========================================
- Hits        18874    13707     -5167     
- Misses      14785    17988     +3203     
+ Partials     2219     1812      -407     
Flag Coverage Δ
dm 23.92% <2.94%> (-0.23%) ⬇️
playground ?
unittest ?

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

Impacted Files Coverage Δ
pkg/cluster/spec/cdc.go 45.96% <0.00%> (-14.28%) ⬇️
pkg/cluster/operation/scale_in.go 51.54% <59.38%> (-2.91%) ⬇️
pkg/cluster/operation/upgrade.go 26.29% <100.00%> (-23.71%) ⬇️
pkg/utils/regexp.go 0.00% <0.00%> (-100.00%) ⬇️
components/dm/ansible/worker.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/utils/freeport.go 0.00% <0.00%> (-77.42%) ⬇️
pkg/meta/err.go 0.00% <0.00%> (-76.19%) ⬇️
pkg/utils/semver.go 8.38% <0.00%> (-76.05%) ⬇️
pkg/cluster/api/error.go 0.00% <0.00%> (-75.00%) ⬇️
pkg/crypto/rand/passwd.go 0.00% <0.00%> (-75.00%) ⬇️
... and 129 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 4, 2022
@3AceShowHand 3AceShowHand changed the title [DNM] scale-in pd leader after evict the leader scale-in pd leader after evict the leader Aug 5, 2022
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 9, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 9, 2022
@srstack
Copy link
Collaborator

srstack commented Aug 9, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: c061391

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 9, 2022
@ti-chi-bot ti-chi-bot merged commit b11f1c4 into pingcap:master Aug 10, 2022
@nexustar nexustar added this to the v1.11.0 milestone Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scale-in pd instances should defer the leader and transfer the leadership
6 participants