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 panic caused by removing tombstone #2015

Merged
merged 3 commits into from
Dec 17, 2019

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Dec 13, 2019

What problem does this PR solve?

Fixes #1979.

What is changed and how it works?

This PR fixes the panic problem by resetting the attached function when removing the store limit.

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx rleungx added needs-cherry-pick-release-3.0 The PR needs to cherry pick to release-3.0 branch. needs-cherry-pick-release-3.1 The PR needs to cherry pick to release-3.1 branch. labels Dec 13, 2019
@rleungx rleungx added this to the v4.0.0-beta milestone Dec 13, 2019
@rleungx rleungx added the type/bug The issue is confirmed as a bug. label Dec 13, 2019
@codecov-io
Copy link

codecov-io commented Dec 13, 2019

Codecov Report

Merging #2015 into master will decrease coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2015      +/-   ##
=========================================
- Coverage   77.52%   77.4%   -0.12%     
=========================================
  Files         180     180              
  Lines       18108   18109       +1     
=========================================
- Hits        14038   14018      -20     
- Misses       3013    3025      +12     
- Partials     1057    1066       +9
Impacted Files Coverage Δ
server/schedule/operator_controller.go 83.78% <100%> (+0.02%) ⬆️
pkg/etcdutil/etcdutil.go 82.6% <0%> (-8.7%) ⬇️
server/schedulers/random_merge.go 60.71% <0%> (-3.58%) ⬇️
server/member/leader.go 76.53% <0%> (-3.07%) ⬇️
pkg/mock/mockhbstream/mockhbstream.go 89.23% <0%> (-1.54%) ⬇️
client/client.go 70.9% <0%> (-1.23%) ⬇️
server/handler.go 51.13% <0%> (-0.46%) ⬇️
server/grpc_service.go 58.53% <0%> (-0.44%) ⬇️
server/tso/tso.go 81.02% <0%> (+0.72%) ⬆️
pkg/metricutil/metricutil.go 100% <0%> (+9.37%) ⬆️

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 2a72c15...3a73039. Read the comment docs.

@@ -899,5 +899,6 @@ func (oc *OperatorController) GetLeaderScheduleStrategy() core.ScheduleStrategy
func (oc *OperatorController) RemoveStoreLimit(storeID uint64) {
oc.Lock()
defer oc.Unlock()
oc.cluster.AttachAvailableFunc(storeID, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

why is nil rather than func(){ return false }

Copy link
Member Author

Choose a reason for hiding this comment

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

I just reset to the original value when the store limit does not exist.

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

LGTM.

@nolouch
Copy link
Contributor

nolouch commented Dec 17, 2019

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 17, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

@rleungx merge failed.

@lhy1024
Copy link
Contributor

lhy1024 commented Dec 17, 2019

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

Your auto merge job has been accepted, waiting for 2014

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

/run-all-tests

@sre-bot sre-bot merged commit 887cc4c into tikv:master Dec 17, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

cherry pick to release-3.0 failed

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

cherry pick to release-3.1 failed

Huster-ljw pushed a commit to Huster-ljw/pd that referenced this pull request Dec 18, 2019
Signed-off-by: Ryan Leung <rleungx@gmail.com>
rleungx added a commit to rleungx/pd that referenced this pull request Dec 18, 2019
Signed-off-by: Ryan Leung <rleungx@gmail.com>
rleungx added a commit to rleungx/pd that referenced this pull request Dec 18, 2019
Signed-off-by: Ryan Leung <rleungx@gmail.com>
nolouch pushed a commit that referenced this pull request Dec 18, 2019
Signed-off-by: Ryan Leung <rleungx@gmail.com>
disksing pushed a commit that referenced this pull request Dec 19, 2019
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-3.0 The PR needs to cherry pick to release-3.0 branch. needs-cherry-pick-release-3.1 The PR needs to cherry pick to release-3.1 branch. status/can-merge Indicates a PR has been approved by a committer. type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replica checker cause panic
5 participants