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

pkg: delete config when QPS and concurrency are both deleted #8653

Merged
merged 8 commits into from
Sep 30, 2024

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Sep 24, 2024

What problem does this PR solve?

Issue Number: Ref #4373.

What is changed and how does it work?

Check List

Tests

  • Unit test

Release note

None.

@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. dco-signoff: yes Indicates the PR's author has signed the dco. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 24, 2024
@ti-chi-bot ti-chi-bot bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 24, 2024
@rleungx rleungx changed the title server: case insensitive and delete config when QPS and concurrency set to 0 pkg: delete config when QPS and concurrency set to 0 Sep 24, 2024
@rleungx rleungx changed the title pkg: delete config when QPS and concurrency set to 0 pkg: delete config when QPS and concurrency are both deleted Sep 24, 2024
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 75.75758% with 16 lines in your changes missing coverage. Please review.

Project coverage is 77.50%. Comparing base (26ced22) to head (4109a9a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8653      +/-   ##
==========================================
- Coverage   77.54%   77.50%   -0.04%     
==========================================
  Files         474      474              
  Lines       62359    62352       -7     
==========================================
- Hits        48358    48328      -30     
- Misses      10441    10446       +5     
- Partials     3560     3578      +18     
Flag Coverage Δ
unittests 77.50% <75.75%> (-0.04%) ⬇️

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

return lim.(*limiter).updateDimensionConfig(cfg)
status := lim.(*limiter).updateDimensionConfig(cfg)
if status&QPSDeleted != 0 && status&ConcurrencyDeleted != 0 {
l.limiters.Delete(label)
Copy link
Contributor

Choose a reason for hiding this comment

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

What will happen if this is not removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

leave a config in output that is meaningless

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Sep 25, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 26, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 26, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-25 03:12:54.413641848 +0000 UTC m=+1622044.154065771: ☑️ agreed by lhy1024.
  • 2024-09-26 02:53:49.376687356 +0000 UTC m=+1707299.117111288: ☑️ agreed by okJiang.

@rleungx
Copy link
Member Author

rleungx commented Sep 26, 2024

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 26, 2024
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 26, 2024
@rleungx
Copy link
Member Author

rleungx commented Sep 26, 2024

I made more changes. PTAL @lhy1024 @okJiang

Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
@@ -89,6 +83,6 @@ func InitLimiter() Option {
return InAllowList
}
l.limiters.LoadOrStore(label, newLimiter())
return ConcurrencyChanged
return LimiterNotChanged
Copy link
Member

Choose a reason for hiding this comment

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

Has there been a change here, as expected?

Copy link
Member Author

@rleungx rleungx Sep 29, 2024

Choose a reason for hiding this comment

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

Yes, the limit is not changed when we initialize the limiter.

if limit <= eps || burst < 1 {
l.rate = nil
if l.isEmpty() {
return LimiterDeleted
Copy link
Member

Choose a reason for hiding this comment

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

Should this be LimiterNoChanged?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, LimiterDeleted indicates that we should remove the corresponding label from the config.

Copy link
Contributor

ti-chi-bot bot commented Sep 30, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lhy1024, okJiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rleungx
Copy link
Member Author

rleungx commented Sep 30, 2024

/hold cancel

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 30, 2024
@ti-chi-bot ti-chi-bot bot merged commit 76bc34a into tikv:master Sep 30, 2024
25 checks passed
@rleungx rleungx deleted the case-delete branch September 30, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants