-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
sysvar, config: introduce tidb_connection_concurrency_limit as an instance scope sysvar. #34662
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/2985c9ad767a03a68d22ee0fa5d8ef5c5a0dd345 |
concurrentLimiter: NewTokenLimiter(cfg.TokenLimit), | ||
concurrentLimiter: NewTokenLimiter(uint(cfg.Instance.ConnectionConcurrencyLimit)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will just be passed to server/
when the server starts?
If so, it will need to be refactored, since making changes to the sysvar won't apply until restart (which is a problem for instance vars, since the values are lost on restart too).
@CbcWestwolf Please fix linter issues:
|
server/conn.go
Outdated
@@ -1324,6 +1324,7 @@ func (cc *clientConn) dispatch(ctx context.Context, data []byte) error { | |||
} | |||
|
|||
cc.server.releaseToken(token) | |||
cc.server.UpdateTokenLimiter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why update here and not in the SetGlobal func?
Thanks, it is updated. PTAL. |
I was actually wondering the same thing. I think we might need to test it. The other option is to refactor to use an atomic for the limit, and not use a resizer. It probably does change quite a bit of code though, so I'm not sure if its better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please fix conflicts
@CbcWestwolf: PR needs rebase. 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 kubernetes/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34662 +/- ##
=================================================
+ Coverage 61.8719% 73.8153% +11.9434%
=================================================
Files 891 990 +99
Lines 284074 313741 +29667
=================================================
+ Hits 175762 231589 +55827
+ Misses 94536 67553 -26983
- Partials 13776 14599 +823 |
@CbcWestwolf: The following test failed, say
Full PR test history. Your PR dashboard. 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 kubernetes/test-infra repository. I understand the commands that are listed here. |
@CbcWestwolf: The following tests failed, say
Full PR test history. Your PR dashboard. 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 kubernetes/test-infra repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #34583
Problem Summary:
For
token-limit
there is a use-case to make it online configurable. And the name oftoken-limit
is too tied to an implementation, not what the feature does.What is changed and how it works?
Introducing
tidb_connection_concurrency_limit
as a sysvar and a config item in[instance]
section.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.