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

mcs/resourcemanager: delete expire tokenSlot #7344

Merged
merged 12 commits into from
Nov 10, 2023

Conversation

guo-shaoge
Copy link
Contributor

@guo-shaoge guo-shaoge commented Nov 9, 2023

What problem does this PR solve?

If tidb/tiflash crash unexpectly or killed by signal which cannot be handled, there will be a useless slot, which will cause fillrate/burstlimit become less than expected for other alive ones.
So add a expire timeout(10min).

Issue Number: Close #7346

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

None.

Copy link
Contributor

ti-chi-bot bot commented Nov 9, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • HuSharp

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 bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. labels Nov 9, 2023
@ti-chi-bot ti-chi-bot bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 9, 2023
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #7344 (473b423) into master (0c35227) will increase coverage by 0.07%.
The diff coverage is 63.63%.

@@            Coverage Diff             @@
##           master    #7344      +/-   ##
==========================================
+ Coverage   74.36%   74.44%   +0.07%     
==========================================
  Files         446      446              
  Lines       48441    48451      +10     
==========================================
+ Hits        36025    36071      +46     
+ Misses       9234     9190      -44     
- Partials     3182     3190       +8     
Flag Coverage Δ
unittests 74.44% <63.63%> (+0.07%) ⬆️

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

Signed-off-by: guo-shaoge <[email protected]>
Signed-off-by: guo-shaoge <[email protected]>
Signed-off-by: guo-shaoge <[email protected]>
@HuSharp HuSharp requested review from CabinfeverB and HuSharp and removed request for JmPotato and disksing November 10, 2023 02:10
@@ -139,6 +147,13 @@ func (gts *GroupTokenBucketState) balanceSlotTokens(
}
}

for clientUniqueID, slot := range gts.tokenSlots {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need check this every handling request?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should refine so we can check every 10mins

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add gts.lastCheckExpireSlot as a guard

Signed-off-by: guo-shaoge <[email protected]>
Signed-off-by: guo-shaoge <[email protected]>
Comment on lines 117 to 118
now := time.Now()
gts.lastCheckExpireSlot = now
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to check expiration here first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted, no need to update here

Signed-off-by: guo-shaoge <[email protected]>
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. and removed do-not-merge/needs-triage-completed labels Nov 10, 2023
@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 10, 2023
Copy link
Member

@HuSharp HuSharp left a comment

Choose a reason for hiding this comment

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

rest LGTM!

@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 10, 2023
@HuSharp
Copy link
Member

HuSharp commented Nov 10, 2023

seems like DCO is wrong with sign-off is missing :) @guo-shaoge

Commit sha: [6122ee9](https://github.com/tikv/pd/pull/7344/commits/6122ee9c413627d4027da7dc0e80b1e6a9c3dd70), Author: guo-shaoge, Committer: GitHub; The sign-off is missing.
Commit sha: [7201cce](https://github.com/tikv/pd/pull/7344/commits/7201cce1cfabad5d42c2f87efac6510fe2453356), Author: guo-shaoge, Committer: GitHub; The sign-off is missing.

Signed-off-by: guo-shaoge <[email protected]>
@guo-shaoge
Copy link
Contributor Author

seems like DCO is wrong with sign-off is missing :) @guo-shaoge

Commit sha: [6122ee9](https://github.com/tikv/pd/pull/7344/commits/6122ee9c413627d4027da7dc0e80b1e6a9c3dd70), Author: guo-shaoge, Committer: GitHub; The sign-off is missing.
Commit sha: [7201cce](https://github.com/tikv/pd/pull/7344/commits/7201cce1cfabad5d42c2f87efac6510fe2453356), Author: guo-shaoge, Committer: GitHub; The sign-off is missing.

fixed

@CabinfeverB
Copy link
Member

CabinfeverB commented Nov 10, 2023

No test in this PR, can u do a manual test? @guo-shaoge
I also agree to merge first and make up later

@guo-shaoge
Copy link
Contributor Author

No test in this PR, can u do a manual test? @guo-shaoge I also agree to merge first and make up later

tested last night.

  1. setup cluster
  2. kill -9 tiflash
  3. wait 10mins and check pd log
image

@CabinfeverB
Copy link
Member

/merge

Copy link
Contributor

ti-chi-bot bot commented Nov 10, 2023

@CabinfeverB: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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.

Copy link
Contributor

ti-chi-bot bot commented Nov 10, 2023

This pull request has been accepted and is ready to merge.

Commit hash: 473b423

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 10, 2023
@ti-chi-bot ti-chi-bot bot merged commit f1cee6c into tikv:master Nov 10, 2023
24 of 26 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #7349.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #7350.

ti-chi-bot bot pushed a commit that referenced this pull request Nov 10, 2023
ti-chi-bot bot added a commit that referenced this pull request Dec 11, 2023
close #7346

Signed-off-by: guo-shaoge <[email protected]>

Co-authored-by: guo-shaoge <[email protected]>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. 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.

remove legacy tokenSlot of resource group bucket
4 participants