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: fix the store limit cannot be persisted #3380

Merged
merged 8 commits into from
Jan 28, 2021

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Jan 22, 2021

What problem does this PR solve?

The store limit cannot persist due to we only change the value in the memory. Close #3382.

What is changed and how it works?

This PR persists the store limit once it changes and if persistence fails, we will roll back to the original one.

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Fix the issue that the store limit cannot be persisted

@rleungx rleungx added the component/config Configuration logic. label Jan 22, 2021
@codecov
Copy link

codecov bot commented Jan 22, 2021

Codecov Report

Merging #3380 (b9c4583) into master (680a3a4) will decrease coverage by 0.17%.
The diff coverage is 58.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3380      +/-   ##
==========================================
- Coverage   75.06%   74.88%   -0.18%     
==========================================
  Files         243      243              
  Lines       23325    23353      +28     
==========================================
- Hits        17510    17489      -21     
- Misses       4256     4292      +36     
- Partials     1559     1572      +13     
Flag Coverage Δ
unittests 74.88% <58.33%> (-0.18%) ⬇️

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

Impacted Files Coverage Δ
server/config/persist_options.go 91.33% <50.00%> (ø)
server/cluster/cluster.go 82.33% <54.83%> (-1.36%) ⬇️
server/handler.go 41.97% <100.00%> (-0.29%) ⬇️
pkg/tempurl/tempurl.go 45.00% <0.00%> (-15.00%) ⬇️
server/schedulers/shuffle_hot_region.go 54.73% <0.00%> (-9.48%) ⬇️
pkg/dashboard/adapter/manager.go 84.78% <0.00%> (-7.61%) ⬇️
server/tso/global_allocator.go 68.99% <0.00%> (-6.98%) ⬇️
server/tso/local_allocator.go 82.08% <0.00%> (-2.99%) ⬇️
server/tso/tso.go 81.48% <0.00%> (-1.86%) ⬇️
server/member/member.go 68.47% <0.00%> (-1.64%) ⬇️
... and 11 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 680a3a4...b9c4583. Read the comment docs.

c.opt.SetStoreLimit(storeID, typ, ratePerMin)
if err := c.opt.Persist(c.storage); err != nil {
// roll back the store limit
c.opt.SetScheduleConfig(old)
Copy link
Member

Choose a reason for hiding this comment

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

What will happen if the rollback operation fails also?

Copy link
Member Author

Choose a reason for hiding this comment

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

The rollback operation only resets the memory value

@rleungx rleungx added needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. needs-cherry-pick-5.0-rc labels Jan 26, 2021
Copy link
Contributor

@Yisaer Yisaer left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 26, 2021
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
@rleungx
Copy link
Member Author

rleungx commented Jan 27, 2021

I made some new changes, PTAL @Yisaer @JmPotato

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • HunDunDM
  • Yisaer

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@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 Jan 27, 2021
@lhy1024
Copy link
Contributor

lhy1024 commented Jan 28, 2021

/merge

@ti-chi-bot
Copy link
Member

@lhy1024: 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: 4041a3a

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

@Yisaer Yisaer left a comment

Choose a reason for hiding this comment

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

LGTM

@Yisaer
Copy link
Contributor

Yisaer commented Jan 28, 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.

@nolouch
Copy link
Contributor

nolouch commented Jan 28, 2021

/merge

@ti-chi-bot
Copy link
Member

@nolouch: 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.

Signed-off-by: Ryan Leung <[email protected]>
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jan 28, 2021
@rleungx
Copy link
Member Author

rleungx commented Jan 28, 2021

/run-integration-lightning-test

@HunDunDM
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

@HunDunDM: 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: 0a1a883

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

@rleungx: Your PR has out-of-dated, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/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.

@rleungx
Copy link
Member Author

rleungx commented Jan 28, 2021

/run-unit-tests

@rleungx
Copy link
Member Author

rleungx commented Jan 28, 2021

/rebuild

@rleungx
Copy link
Member Author

rleungx commented Jan 28, 2021

/run-all-tests

1 similar comment
@HunDunDM
Copy link
Member

/run-all-tests

@ti-chi-bot ti-chi-bot merged commit 028befd into tikv:master Jan 28, 2021
ti-srebot pushed a commit to ti-srebot/pd that referenced this pull request Jan 28, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #3403

ti-srebot pushed a commit to ti-srebot/pd that referenced this pull request Jan 28, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0-rc in PR #3404

rleungx added a commit to ti-srebot/pd that referenced this pull request Jan 28, 2021
ti-chi-bot pushed a commit that referenced this pull request Jan 28, 2021
Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: Ryan Leung <[email protected]>
Co-authored-by: 混沌DM <[email protected]>
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-4.0 The PR needs to cherry pick to release-4.0 branch. 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.

Store limit isn't persist when we restart the server
8 participants