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 race in hot region config #4167

Merged
merged 2 commits into from
Sep 27, 2021
Merged

*: fix race in hot region config #4167

merged 2 commits into from
Sep 27, 2021

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Sep 27, 2021

What problem does this PR solve?

Close #4159.

What is changed and how it works?

Use the lock correctly.

Check List

Tests

  • Unit test

Release note

Fix the data race problem of hot region config

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx rleungx added the component/config Configuration logic. label Sep 27, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 27, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • lhy1024

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 Denotes a PR that will be considered when it comes time to generate release notes. label Sep 27, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 27, 2021
@rleungx rleungx requested a review from nolouch September 27, 2021 07:56
@rleungx
Copy link
Member Author

rleungx commented Sep 27, 2021

/run-unit-test

@codecov
Copy link

codecov bot commented Sep 27, 2021

Codecov Report

Merging #4167 (962cace) into master (455a2f9) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4167      +/-   ##
==========================================
+ Coverage   74.59%   74.63%   +0.03%     
==========================================
  Files         260      260              
  Lines       26479    26481       +2     
==========================================
+ Hits        19753    19764      +11     
+ Misses       4945     4940       -5     
+ Partials     1781     1777       -4     
Flag Coverage Δ
unittests 74.63% <100.00%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
server/schedulers/hot_region_config.go 92.09% <100.00%> (+0.09%) ⬆️
server/kv/etcd_kv.go 69.56% <0.00%> (-10.15%) ⬇️
server/region_syncer/client.go 77.46% <0.00%> (-4.23%) ⬇️
server/tso/tso.go 61.93% <0.00%> (-2.28%) ⬇️
server/server.go 70.35% <0.00%> (-1.05%) ⬇️
server/election/leadership.go 77.31% <0.00%> (-1.04%) ⬇️
server/grpc_service.go 46.37% <0.00%> (-0.69%) ⬇️
client/base_client.go 81.52% <0.00%> (-0.55%) ⬇️
client/client.go 71.94% <0.00%> (-0.14%) ⬇️
server/tso/allocator_manager.go 65.16% <0.00%> (+0.33%) ⬆️
... 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 455a2f9...962cace. Read the comment docs.

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@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 Sep 27, 2021
@rleungx
Copy link
Member Author

rleungx commented Sep 27, 2021

/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: 962cace

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 27, 2021
@rleungx rleungx added the needs-cherry-pick-release-5.2 Type: Need cherry pick to release-5.2 label Sep 27, 2021
@ti-chi-bot ti-chi-bot merged commit 7c76c98 into tikv:master Sep 27, 2021
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4170.

HunDunDM added a commit to HunDunDM/pd that referenced this pull request Sep 28, 2021
Signed-off-by: HunDunDM <hundundm@gmail.com>
zhouqiang-cl pushed a commit that referenced this pull request Sep 28, 2021
Signed-off-by: HunDunDM <hundundm@gmail.com>
@rleungx rleungx deleted the fix-race3 branch October 9, 2021 06:55
ti-chi-bot added a commit that referenced this pull request Oct 13, 2021
* fix race in hot region config

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* address the comment

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
hzh0425 pushed a commit to hzh0425/pd that referenced this pull request Nov 16, 2021
* fix race in hot region config

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* address the comment

Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: hzh0425 <642256541@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/config Configuration logic. needs-cherry-pick-release-5.2 Type: Need cherry pick to release-5.2 release-note Denotes a PR that will be considered when it comes time to generate release notes. 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 hotregion
4 participants