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

schedule: fix race for region scatter #3760

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

Yisaer
Copy link
Contributor

@Yisaer Yisaer commented Jun 10, 2021

Signed-off-by: yisaer disxiaofei@163.com

What problem does this PR solve?

As totalCountByStore calling the function getDistributionByGroupLocked, this function should be procteded by rw mutex otherwise it will cause data race panic

What is changed and how it works?

Add mutex to protect it.

Check List

Tests

  • Unit test

Release note

Fix pd may get panic during scattering region

Signed-off-by: yisaer <disxiaofei@163.com>
@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 Jun 10, 2021
@Yisaer Yisaer added needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. needs-cherry-pick-release-5.0 The PR needs to cherry pick to release-5.0 branch. needs-cherry-pick-release-5.1 Type: Need cherry pick to release-5.1 labels Jun 10, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 10, 2021
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • HunDunDM
  • 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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 10, 2021
@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 10, 2021

/merge

@ti-chi-bot
Copy link
Member

@Yisaer: 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: 2405e70

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 10, 2021
@codecov
Copy link

codecov bot commented Jun 10, 2021

Codecov Report

Merging #3760 (2405e70) into master (3ba158c) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3760      +/-   ##
==========================================
- Coverage   75.09%   75.05%   -0.04%     
==========================================
  Files         245      245              
  Lines       24544    24546       +2     
==========================================
- Hits        18432    18424       -8     
- Misses       4496     4502       +6     
- Partials     1616     1620       +4     
Flag Coverage Δ
unittests 75.05% <100.00%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
server/schedule/region_scatterer.go 83.87% <100.00%> (-4.51%) ⬇️
server/tso/local_allocator.go 80.55% <0.00%> (-9.73%) ⬇️
server/region_syncer/server.go 83.33% <0.00%> (-6.07%) ⬇️
server/statistics/hot_cache_task.go 71.92% <0.00%> (-3.51%) ⬇️
server/encryptionkm/key_manager.go 71.78% <0.00%> (-1.66%) ⬇️
server/tso/tso.go 70.78% <0.00%> (-1.13%) ⬇️
server/server.go 71.62% <0.00%> (-0.76%) ⬇️
server/cluster/coordinator.go 72.42% <0.00%> (-0.72%) ⬇️
server/tso/allocator_manager.go 79.63% <0.00%> (-0.67%) ⬇️
... and 10 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 3ba158c...2405e70. Read the comment docs.

@ti-chi-bot ti-chi-bot merged commit 5327896 into tikv:master Jun 10, 2021
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot added a commit that referenced this pull request Jun 15, 2021
Signed-off-by: yisaer <disxiaofei@163.com>

Co-authored-by: yisaer <disxiaofei@163.com>
ti-chi-bot added a commit that referenced this pull request Jun 25, 2021
Signed-off-by: yisaer <disxiaofei@163.com>

Co-authored-by: yisaer <disxiaofei@163.com>
bufferflies pushed a commit to bufferflies/pd that referenced this pull request Jul 9, 2021
Signed-off-by: yisaer <disxiaofei@163.com>
bufferflies pushed a commit to bufferflies/pd that referenced this pull request Jul 9, 2021
Signed-off-by: yisaer <disxiaofei@163.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. needs-cherry-pick-release-5.0 The PR needs to cherry pick to release-5.0 branch. needs-cherry-pick-release-5.1 Type: Need cherry pick to release-5.1 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.

4 participants