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

snap_recovery: added keep leader #15124

Merged
merged 14 commits into from
Aug 1, 2023
Merged

Conversation

YuJuncen
Copy link
Contributor

What is changed and how it works?

Issue Number: Close #15122

What's Changed:
This PR added a structure named LeaderKeeper in RecoveryRegion API. That will use LeaderCallback to check whether the leader is lost and if so, send Campaign if there were leadership lost.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Release note

None

Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 14, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • hicqu
  • tonyxuqqi

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 bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 14, 2023
Signed-off-by: hillium <yujuncen@pingcap.com>
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. and removed do-not-merge/needs-triage-completed labels Jul 14, 2023
@tonyxuqqi tonyxuqqi requested a review from overvenus July 14, 2023 07:57
@tonyxuqqi
Copy link
Contributor

@YuJuncen Could you elaborate how does this PR to solve the #15122?
Is it by reducing election message count?

@YuJuncen
Copy link
Contributor Author

@tonyxuqqi This simply poll the leader state (via LeaderCallback) every 30s, and if it found there are regions that should be but not be leader, we manually request it campaign again.

Signed-off-by: hillium <yujuncen@pingcap.com>
@YuJuncen YuJuncen requested a review from hicqu July 19, 2023 02:56
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>

fn force_leader(&self, region_id: u64) -> Result<()> {
let msg = CasualMessage::Campaign;
self.router.send(region_id, msg)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to keep the log "region starts to campaign"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure, somethings it gets so verbose that some of logs will be dropped.

@ti-chi-bot ti-chi-bot bot added status/LGT1 Indicates that a PR has LGTM 1. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 24, 2023
Signed-off-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 28, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 28, 2023

@Leavrth: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

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.

@tonyxuqqi
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 31, 2023

@tonyxuqqi: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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
Contributor

ti-chi-bot bot commented Jul 31, 2023

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

Commit hash: 3692169

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 31, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 31, 2023

@YuJuncen: Your PR was out of date, I have automatically updated it for you.

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.

@BornChanger
Copy link
Contributor

/retest

@ti-chi-bot ti-chi-bot bot removed the status/can-merge Indicates a PR has been approved by a committer. label Aug 1, 2023
@YuJuncen
Copy link
Contributor Author

YuJuncen commented Aug 1, 2023

/test

@YuJuncen
Copy link
Contributor Author

YuJuncen commented Aug 1, 2023

/retest

1 similar comment
@YuJuncen
Copy link
Contributor Author

YuJuncen commented Aug 1, 2023

/retest

@hicqu
Copy link
Contributor

hicqu commented Aug 1, 2023

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 1, 2023

@hicqu: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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
Contributor

ti-chi-bot bot commented Aug 1, 2023

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

Commit hash: b717842

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 1, 2023
@ti-chi-bot ti-chi-bot bot merged commit 4e3102e into tikv:master Aug 1, 2023
1 check passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Aug 1, 2023
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #15263.

ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Aug 1, 2023
close tikv#15122

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

In response to a cherrypick label: new pull request created to branch release-7.1: #15264.

ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Aug 1, 2023
close tikv#15122

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
YuJuncen added a commit to ti-chi-bot/tikv that referenced this pull request Aug 2, 2023
close tikv#15122

Signed-off-by: hillium <yujuncen@pingcap.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot added a commit that referenced this pull request Aug 2, 2023
close #15122

Signed-off-by: hillium <yujuncen@pingcap.com>

Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
YuJuncen added a commit to ti-chi-bot/tikv that referenced this pull request Oct 10, 2023
close tikv#15122

Signed-off-by: hillium <yujuncen@pingcap.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot added a commit that referenced this pull request Oct 13, 2023
close #15122

Signed-off-by: hillium <yujuncen@pingcap.com>

Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
Co-authored-by: tonyxuqqi <tonyxuqi@outlook.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. 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.

snap_restore: when there are message dropping, snap_restore may fail
6 participants