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

config: improve scheduler config reload behavior (#2592) #2608

Merged
merged 3 commits into from
Jul 3, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #2592 to release-4.0


Signed-off-by: disksing i@disksing.com

What problem does this PR solve?

Stale scheduler may appear after PD leader change, caused by the reload behavior that it merges in-memory config with persist config.

What is changed and how it works?

Drop in-memory state and merge default schedulers with persist configuration.

Check List

Tests

  • Unit test
  • Manually test
start 3pd + 1tikv
add evict-leader-scheduler-1
remove evict-leader-scheduler-1
kill pd1
show schedulers
make sure there is no evict-leader-scheduler-1

Release note

  • Fix the problem of stale scheduler after leader change

Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
@codecov-commenter
Copy link

Codecov Report

Merging #2608 into release-4.0 will decrease coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-4.0    #2608      +/-   ##
===============================================
- Coverage        77.09%   77.01%   -0.08%     
===============================================
  Files              205      205              
  Lines            22138    22119      -19     
===============================================
- Hits             17068    17036      -32     
- Misses            3765     3779      +14     
+ Partials          1305     1304       -1     
Impacted Files Coverage Δ
server/config/config.go 76.65% <100.00%> (-0.69%) ⬇️
server/config/persist_options.go 89.72% <100.00%> (-0.72%) ⬇️
server/schedulers/shuffle_hot_region.go 63.47% <0.00%> (-11.31%) ⬇️
pkg/etcdutil/etcdutil.go 82.60% <0.00%> (-8.70%) ⬇️
server/region_syncer/client.go 78.62% <0.00%> (-3.06%) ⬇️
server/member/leader.go 72.37% <0.00%> (-1.95%) ⬇️
server/server.go 75.86% <0.00%> (-0.76%) ⬇️
server/schedule/operator_controller.go 81.25% <0.00%> (-0.17%) ⬇️
server/cluster/cluster.go 80.99% <0.00%> (+0.31%) ⬆️
... and 8 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 9f79697...2cec7e4. Read the comment docs.

Copy link
Member

@HunDunDM HunDunDM left a comment

Choose a reason for hiding this comment

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

LGTM

@HunDunDM
Copy link
Member

HunDunDM commented Jul 3, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 3, 2020
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit 522941d into tikv:release-4.0 Jul 3, 2020
@disksing disksing deleted the release-4.0-e91c4f43eeb8 branch December 24, 2020 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/config Configuration logic. status/can-merge Indicates a PR has been approved by a committer. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants