-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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, sysvar: map max-server-connections
to max_connections
#35453
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. |
/run-unit-test |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/eae00b1001584ac15c4fcabb6599e8ee1675efee |
/cc morgo bb7133 zimulala xiongjiwei |
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.
Looks great! Can you manual test as well: what happens when you have 10 idle connections on a server, and then you set the max_connections to 5? I assume from the code it takes effect on the next connection, and the existing connections work fine.
For another test: what happens when you have 10 idle, and set the max_connections to 12? Do 2 new connections come in with no problems, but the 13th breaks?
It looks like the error returned if connections is exceeded is not the best :( This might be an existing bug - here is what MySQL returns:
|
Fixed it. Now the behavior is compatible with MySQL. PTAL :) |
/run-unit-test |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 8a0a06d
|
/hold |
server/server.go
Outdated
// `EOF` means the connection is closed normally, we do not treat it as a noticeable error and log it in 'DEBUG' level. | ||
logutil.BgLogger().With(zap.Uint64("conn", conn.connectionID)). | ||
Debug("EOF", zap.String("remote addr", conn.bufReadConn.RemoteAddr().String())) | ||
} else { | ||
case errConCount: | ||
_ = conn.writeError(ctx, err) |
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.
_ = conn.writeError(ctx, err) | |
_ = conn.writeError(ctx, err) |
Please handle the error here, you could simply write an log for it.
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.
Fixed. PTAL :)
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
/merge |
This pull request has been accepted and is ready to merge. Commit hash: a975923
|
/unhold |
/run-unit-test |
/run-realtikv-test |
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
* upstream/master: (38 commits) planner: disable collate clause support for enum or set column (pingcap#35684) *: Provide a util to "pause" session in uint test (pingcap#35529) ddl: implement the core for multi-schema change (pingcap#35429) parser: XXXDatabaseStmt now use CIStr for DB name (pingcap#35668) *: remove real tikv test on github actions (pingcap#35710) lightning: support disable scheduler by key range (pingcap#34130) Revert "planner: fix the wrong cost formula of MPPExchanger" (pingcap#35707) ddl, owner: refresh ddl sequence cache after becoming the owner (pingcap#35516) store/copr: fix tiflash integration test by disable paging on tiflash (pingcap#35674) planner: new cost formula for IndexJoin (pingcap#35671) BR: fix backup ranges total time summary log (pingcap#35552) raw_restore: fix the issue that raw restore rewrite the t prefix keys (pingcap#35641) table: fix cannot find the temp table when it's created in a transaction (pingcap#35663) metrics: replace histogram with counter for DistSQLCoprCache (pingcap#35514) *: enable exportloopref (pingcap#35680) types: fix bad error message for numeric conversion issue#32744 (pingcap#34047) *: enable ineffassign (pingcap#35670) config, sysvar: map `max-server-connections` to `max_connections` (pingcap#35453) *: enable durationcheck for nogo linter (pingcap#35661) *: fix issue of cast string as time is incompatible with MySQL (pingcap#35455) ...
What problem does this PR solve?
Issue Number: ref #34960
Problem Summary:
Before, if we want to change the limitation of
max-server-connections
, we have to change the configuration and restart the node. And the system variablemax_connections
is not available.What is changed and how it works?
Add a new config item
instance.max_connections
and make sysvarmax_connections
available.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.