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

mcs: fix potential data race in scheduling server #8539

Merged
merged 3 commits into from
Aug 21, 2024

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Aug 15, 2024

What problem does this PR solve?

Issue Number: Close #8538

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)
for i in {1..100}; do
	go clean -testcache
	go test -timeout 120s -run ^TestAPI$ github.com/tikv/pd/tests/integrations/mcs/scheduling -race
done

Release note

None.

Signed-off-by: lhy1024 <admin@liudos.us>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed dco-signoff: yes Indicates the PR's author has signed the dco. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 15, 2024
Copy link

codecov bot commented Aug 15, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.54%. Comparing base (6bf980d) to head (795ac6b).
Report is 39 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8539      +/-   ##
==========================================
- Coverage   77.55%   77.54%   -0.01%     
==========================================
  Files         474      474              
  Lines       61861    61859       -2     
==========================================
- Hits        47974    47969       -5     
- Misses      10355    10361       +6     
+ Partials     3532     3529       -3     
Flag Coverage Δ
unittests 77.54% <25.00%> (-0.01%) ⬇️

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

}
if !s.IsServing() {
// double check
break
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to add a break label to indicate jumping out of the “for loop”?

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 think it is not necessary.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Aug 16, 2024
@okJiang
Copy link
Member

okJiang commented Aug 20, 2024

ref #8538 (comment)

Is there a way to make s.GetClient().XXXX() non-suspending or report timeout errors when campaigning primary?

@lhy1024
Copy link
Contributor Author

lhy1024 commented Aug 21, 2024

ref #8538 (comment)

Is there a way to make s.GetClient().XXXX() non-suspending or report timeout errors when campaigning primary?

There seems to be no easy way to implement this, and similar problems may also occur in scenarios where there are network problems.

Copy link
Contributor

ti-chi-bot bot commented Aug 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HuSharp, okJiang

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 21, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 21, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-16 07:22:28.577935105 +0000 UTC m=+511833.281404743: ☑️ agreed by HuSharp.
  • 2024-08-21 03:47:23.758740397 +0000 UTC m=+323638.893190518: ☑️ agreed by okJiang.

ti-chi-bot bot and others added 2 commits August 21, 2024 03:48
@ti-chi-bot ti-chi-bot bot merged commit 9c14c63 into tikv:master Aug 21, 2024
21 checks passed
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Sep 22, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot bot pushed a commit that referenced this pull request Sep 23, 2024
close #8538

Signed-off-by: lhy1024 <admin@liudos.us>

Co-authored-by: lhy1024 <admin@liudos.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mcs: potential data race in scheduling server when pd leader switch
4 participants