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

Fix data race,ref #4857 #4996

Merged
merged 2 commits into from
May 20, 2022
Merged

Fix data race,ref #4857 #4996

merged 2 commits into from
May 20, 2022

Conversation

v01dstar
Copy link
Contributor

Signed-off-by: v01dstar [email protected]

What problem does this PR solve?

Issue Number: Close #4857

It was resolved in #4881, then reverted in #4704, I am now fixing the data race in a different way

What is changed and how does it work?

Reorder the code logic, and acquire the lock before modifying the cluster to avoid data race.

Check List

Tests

  • Unit test

Code changes

N/A

Side effects

N/A

Related changes

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 20, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • rleungx

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 release-note-none Denotes a PR that doesn't merit a release note. label May 20, 2022
@ti-chi-bot ti-chi-bot requested review from disksing and Yisaer May 20, 2022 01:18
@v01dstar
Copy link
Contributor Author

/cc @bufferflies

@ti-chi-bot ti-chi-bot requested a review from bufferflies May 20, 2022 01:18
@codecov
Copy link

codecov bot commented May 20, 2022

Codecov Report

Merging #4996 (bb9731d) into master (056ca9d) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4996   +/-   ##
=======================================
  Coverage   75.40%   75.40%           
=======================================
  Files         307      307           
  Lines       30230    30230           
=======================================
+ Hits        22794    22795    +1     
- Misses       5430     5449   +19     
+ Partials     2006     1986   -20     
Flag Coverage Δ
unittests 75.40% <ø> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
server/schedulers/shuffle_hot_region.go 55.55% <0.00%> (-10.11%) ⬇️
server/id/id.go 76.19% <0.00%> (-4.77%) ⬇️
server/grpc_service.go 51.81% <0.00%> (-1.24%) ⬇️
server/schedule/operator_controller.go 84.56% <0.00%> (-1.21%) ⬇️
pkg/etcdutil/etcdutil.go 85.05% <0.00%> (-1.15%) ⬇️
server/region_syncer/server.go 82.06% <0.00%> (-1.09%) ⬇️
server/schedulers/evict_leader.go 78.82% <0.00%> (-0.91%) ⬇️
server/schedulers/hot_region.go 83.04% <0.00%> (-0.30%) ⬇️
server/cluster/coordinator.go 72.13% <0.00%> (+0.40%) ⬆️
server/tso/allocator_manager.go 63.06% <0.00%> (+0.49%) ⬆️
... and 9 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 056ca9d...bb9731d. Read the comment docs.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 20, 2022
@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 May 20, 2022
@rleungx
Copy link
Member

rleungx commented May 20, 2022

/merge

@ti-chi-bot
Copy link
Member

@rleungx: 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

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

Commit hash: 778defc

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

@v01dstar: 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 aafc77d into tikv:master May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. 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.

Data race in TestSplitPaused test
4 participants