-
Notifications
You must be signed in to change notification settings - Fork 718
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
election: fix the data race of the leadership resetting #4102
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: JmPotato <ghzpotato@gmail.com>
0d6401d
to
43373b0
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
06cc1e1
to
c21137a
Compare
Do we need to cherry-pick this PR? |
Codecov Report
@@ Coverage Diff @@
## master #4102 +/- ##
==========================================
+ Coverage 74.40% 74.53% +0.12%
==========================================
Files 258 258
Lines 26322 26323 +1
==========================================
+ Hits 19585 19619 +34
+ Misses 4986 4958 -28
+ Partials 1751 1746 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I think cherry-pick is needed since this data race may affect the normal leadership campaign, i.e, cancel the context immediately after it's set. |
/merge |
@JmPotato: 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. |
This pull request has been accepted and is ready to merge. Commit hash: c21137a
|
/run-unit-test |
* Fix the data race of the leadership resetting Signed-off-by: JmPotato <ghzpotato@gmail.com> * Fix the test Signed-off-by: JmPotato <ghzpotato@gmail.com> * Add a comment Signed-off-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4108. |
Signed-off-by: JmPotato ghzpotato@gmail.com
What problem does this PR solve?
Fix the data race of the leadership resetting.
ref: https://ci2.pingcap.net/blue/rest/organizations/jenkins/pipelines/pd_test/runs/2203/nodes/50/steps/94/log/?start=0
What is changed and how it works?
Make sure the leadership is not expired before resetting it.
Check List
Tests
Release note