Skip to content

executor: introduce max_user_connections | tidb-test=pr/2474#59197

Merged
ti-chi-bot[bot] merged 27 commits intopingcap:masterfrom
joccau:cp-max-user-connections
Feb 26, 2025
Merged

executor: introduce max_user_connections | tidb-test=pr/2474#59197
ti-chi-bot[bot] merged 27 commits intopingcap:masterfrom
joccau:cp-max-user-connections

Conversation

@joccau
Copy link
Contributor

@joccau joccau commented Jan 24, 2025

What problem does this PR solve?

Issue Number: Close #59203

Problem Summary: TiDB can support the feature of max_use_connections.

What changed and how does it work?

  • TiDB supports max_user_connections to limit the login count when login tidb-server.
    • Introduction of the System Variable MAX_USER_CONNECTIONS
    • A new field max_user_connections is added into system table mysql.user.
    • Check user connections when login in TiDB-server.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

integration test case

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

TiDB supports max_user_connections to limits the login count.

@ti-chi-bot ti-chi-bot bot added do-not-merge/invalid-title do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-tests-checked size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 24, 2025
joccau added 2 commits January 24, 2025 17:54
… to community tidb.

Signed-off-by: joccau <zak.zhao@pingcap.cn>
Signed-off-by: joccau <zak.zhao@pingcap.cn>
@joccau joccau force-pushed the cp-max-user-connections branch from c702551 to bad08f0 Compare January 24, 2025 10:04
@joccau joccau changed the title migrate the the feature about max_user_connections from PingkaiDB to community tidb. executor: migrate the the feature about max_user_connections from PingkaiDB to community. Jan 24, 2025
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/invalid-title do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. labels Jan 24, 2025
@joccau joccau force-pushed the cp-max-user-connections branch from 7bd87b1 to ab3c101 Compare January 24, 2025 14:49
Signed-off-by: joccau <zak.zhao@pingcap.cn>
@joccau joccau force-pushed the cp-max-user-connections branch from ab3c101 to 0c43eb2 Compare January 24, 2025 14:50
@joccau joccau changed the title executor: migrate the the feature about max_user_connections from PingkaiDB to community. executor: migrate the the feature about max_user_connections from PingkaiDB to community | tidb-test=pr/2474 Jan 24, 2025
joccau added 2 commits January 24, 2025 22:59
Signed-off-by: joccau <zak.zhao@pingcap.cn>
Signed-off-by: joccau <zak.zhao@pingcap.cn>
Signed-off-by: joccau <zak.zhao@pingcap.cn>
@codecov
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 72.19251% with 52 lines in your changes missing coverage. Please review.

Project coverage is 74.7743%. Comparing base (87f6782) to head (141595a).
Report is 9 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #59197        +/-   ##
================================================
+ Coverage   72.9647%   74.7743%   +1.8096%     
================================================
  Files          1697       1715        +18     
  Lines        468950     470704      +1754     
================================================
+ Hits         342168     351966      +9798     
+ Misses       105711      96983      -8728     
- Partials      21071      21755       +684     
Flag Coverage Δ
integration 46.3377% <54.8022%> (?)
unit 72.3266% <72.1925%> (+0.1557%) ⬆️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 61.4663% <ø> (+16.3499%) ⬆️

Signed-off-by: joccau <zak.zhao@pingcap.cn>
@joccau
Copy link
Contributor Author

joccau commented Feb 7, 2025

/test unit-test

@tiprow
Copy link

tiprow bot commented Feb 7, 2025

@joccau: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

Details

In response to this:

/test unit-test

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-sigs/prow repository.

joccau added 2 commits February 7, 2025 18:09
Signed-off-by: joccau <zak.zhao@pingcap.cn>
…ge of 'create user'.

Signed-off-by: joccau <zak.zhao@pingcap.cn>
@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 25, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 25, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-24 09:52:08.309273099 +0000 UTC m=+263076.262431377: ☑️ agreed by D3Hunter.
  • 2025-02-25 04:17:23.662093098 +0000 UTC m=+329391.615251363: ☑️ agreed by bb7133.

@joccau
Copy link
Contributor Author

joccau commented Feb 25, 2025

/test unit-test

@tiprow
Copy link

tiprow bot commented Feb 25, 2025

@joccau: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

Details

In response to this:

/test unit-test

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-sigs/prow repository.

@joccau
Copy link
Contributor Author

joccau commented Feb 25, 2025

/test tidb_parser_test

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 25, 2025

@joccau: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test build
/test check-dev
/test check-dev2
/test mysql-test
/test pull-br-integration-test
/test pull-integration-ddl-test
/test pull-integration-e2e-test
/test pull-lightning-integration-test
/test pull-mysql-client-test
/test pull-unit-test-ddlv1
/test unit-test

The following commands are available to trigger optional jobs:

/test pingcap/tidb/canary_ghpr_unit_test
/test pull-common-test
/test pull-e2e-test
/test pull-integration-common-test
/test pull-integration-copr-test
/test pull-integration-jdbc-test
/test pull-integration-mysql-test
/test pull-integration-nodejs-test
/test pull-integration-python-orm-test
/test pull-scan-deps
/test pull-sqllogic-test
/test pull-tiflash-test

Use /test all to run the following jobs that were automatically triggered:

pingcap/tidb/ghpr_build
pingcap/tidb/ghpr_check
pingcap/tidb/ghpr_check2
pingcap/tidb/ghpr_mysql_test
pingcap/tidb/ghpr_unit_test
pingcap/tidb/pull_br_integration_test
pingcap/tidb/pull_integration_ddl_test
pingcap/tidb/pull_integration_e2e_test
pingcap/tidb/pull_mysql_client_test
Details

In response to this:

/test tidb_parser_test

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-sigs/prow repository.

@tiprow
Copy link

tiprow bot commented Feb 25, 2025

@ti-chi-bot[bot]: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

Details

In response to this:

@joccau: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test build
/test check-dev
/test check-dev2
/test mysql-test
/test pull-br-integration-test
/test pull-integration-ddl-test
/test pull-integration-e2e-test
/test pull-lightning-integration-test
/test pull-mysql-client-test
/test pull-unit-test-ddlv1
/test unit-test

The following commands are available to trigger optional jobs:

/test pingcap/tidb/canary_ghpr_unit_test
/test pull-common-test
/test pull-e2e-test
/test pull-integration-common-test
/test pull-integration-copr-test
/test pull-integration-jdbc-test
/test pull-integration-mysql-test
/test pull-integration-nodejs-test
/test pull-integration-python-orm-test
/test pull-scan-deps
/test pull-sqllogic-test
/test pull-tiflash-test

Use /test all to run the following jobs that were automatically triggered:

pingcap/tidb/ghpr_build
pingcap/tidb/ghpr_check
pingcap/tidb/ghpr_check2
pingcap/tidb/ghpr_mysql_test
pingcap/tidb/ghpr_unit_test
pingcap/tidb/pull_br_integration_test
pingcap/tidb/pull_integration_ddl_test
pingcap/tidb/pull_integration_e2e_test
pingcap/tidb/pull_mysql_client_test

In response to this:

/test tidb_parser_test

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-sigs/prow repository.

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-sigs/prow repository.

@joccau
Copy link
Contributor Author

joccau commented Feb 25, 2025

/test check-dev2

@tiprow
Copy link

tiprow bot commented Feb 25, 2025

@joccau: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

Details

In response to this:

/test check-dev2

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-sigs/prow repository.

Copy link
Contributor

@BornChanger BornChanger left a comment

Choose a reason for hiding this comment

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

br part lgtm

@joccau
Copy link
Contributor Author

joccau commented Feb 25, 2025

/cc @benmeadowcroft

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 25, 2025

@joccau: GitHub didn't allow me to request PR reviews from the following users: BenMeadowcroft.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

/cc @benmeadowcroft

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-sigs/prow repository.

@joccau
Copy link
Contributor Author

joccau commented Feb 25, 2025

/cc @benmeadowcroft

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 25, 2025

@joccau: GitHub didn't allow me to request PR reviews from the following users: BenMeadowcroft.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

/cc @benmeadowcroft

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-sigs/prow repository.

@joccau
Copy link
Contributor Author

joccau commented Feb 25, 2025

/cc @yudongusa

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 25, 2025

@joccau: GitHub didn't allow me to request PR reviews from the following users: yudongusa.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

/cc @yudongusa

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-sigs/prow repository.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 26, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, BornChanger, D3Hunter, Frank945946, tiancaiamao, yudongusa

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

The pull request process is described here

Details 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

@ti-chi-bot ti-chi-bot bot added the approved label Feb 26, 2025
@joccau
Copy link
Contributor Author

joccau commented Feb 26, 2025

/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 Feb 26, 2025
@joccau
Copy link
Contributor Author

joccau commented Feb 26, 2025

/unhold

@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 Feb 26, 2025
@ti-chi-bot ti-chi-bot bot merged commit 87f6c7b into pingcap:master Feb 26, 2025
33 checks passed
zeminzhou pushed a commit to zeminzhou/tidb that referenced this pull request May 6, 2025
budney pushed a commit to budney/tidb that referenced this pull request May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TiDB supports max_user_connections that limit to login tidb-server for user@host

10 participants