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

*: Support idle transaction timeout #48714

Merged
merged 6 commits into from
Dec 5, 2023

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Nov 20, 2023

What problem does this PR solve?

Issue Number: close #48712

Problem Summary: Support idle transaction timeout.

What is changed and how it works?

This PR adds a system variable tidb_idle_transaction_timeout to support idle transaction timeout. It has the same function as wait_timeout, but only takes effect in connection which in transaction.

- tidb_idle_transaction_timeout
  - Scope: GLOBAL, SESSION
  - Dynamic: YES
  - Data Type: INTEGER
  - Default Value: 0 ( disable )
  - Range: 0 to 31536000
  - Units: Seconds
  - Any idle transaction will be killed after being idle for this many seconds.

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.

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.

Support idle transaction timeout by variable `tidb_idle_transaction_timeout`.

Signed-off-by: crazycs520 <[email protected]>
@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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 20, 2023
Copy link

tiprow bot commented Nov 20, 2023

Hi @crazycs520. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Merging #48714 (34836c6) into master (95759f4) will increase coverage by 0.7527%.
Report is 146 commits behind head on master.
The diff coverage is 77.7777%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #48714        +/-   ##
================================================
+ Coverage   71.1037%   71.8565%   +0.7527%     
================================================
  Files          1364       1407        +43     
  Lines        404136     435305     +31169     
================================================
+ Hits         287356     312795     +25439     
- Misses        96827     103124      +6297     
+ Partials      19953      19386       -567     
Flag Coverage Δ
integration 43.6337% <77.7777%> (?)
unit 71.1037% <ø> (-0.0001%) ⬇️

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

Components Coverage Δ
dumpling 53.9874% <ø> (ø)
parser ∅ <ø> (∅)
br 47.3913% <ø> (-5.6819%) ⬇️

@crazycs520
Copy link
Contributor Author

/retest-required

Copy link

tiprow bot commented Dec 4, 2023

@crazycs520: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest-required

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.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 4, 2023
@crazycs520
Copy link
Contributor Author

/retest-required

Copy link

tiprow bot commented Dec 4, 2023

@crazycs520: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest-required

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.

@crazycs520
Copy link
Contributor Author

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Dec 4, 2023
Signed-off-by: crazycs520 <[email protected]>
@crazycs520
Copy link
Contributor Author

/test tiprow_fast_test

Copy link

ti-chi-bot bot commented Dec 4, 2023

@crazycs520: 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 unit-test

The following commands are available to trigger optional jobs:

  • /test canary-notify-when-compatibility-sections-changed
  • /test pingcap/tidb/canary_ghpr_unit_test
  • /test pull-br-integration-test
  • /test pull-common-test
  • /test pull-e2e-test
  • /test pull-integration-common-test
  • /test pull-integration-copr-test
  • /test pull-integration-ddl-test
  • /test pull-integration-jdbc-test
  • /test pull-integration-mysql-test
  • /test pull-integration-nodejs-test
  • /test pull-lightning-integration-test
  • /test pull-mysql-client-test
  • /test pull-sqllogic-test
  • /test pull-tiflash-test

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

  • pingcap/tidb/canary_ghpr_unit_test
  • pingcap/tidb/ghpr_build
  • pingcap/tidb/ghpr_check
  • pingcap/tidb/ghpr_check2
  • pingcap/tidb/ghpr_mysql_test
  • pingcap/tidb/ghpr_unit_test

In response to this:

/test tiprow_fast_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/test-infra repository.

Copy link

@benmaoer benmaoer left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Dec 4, 2023

@benmaoer: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

LGTM

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.

@crazycs520
Copy link
Contributor Author

/retest-required

@easonn7
Copy link

easonn7 commented Dec 5, 2023

/approve

@ti-chi-bot ti-chi-bot bot added the approved label Dec 5, 2023
@crazycs520
Copy link
Contributor Author

/test tiprow_fast_test

Copy link

ti-chi-bot bot commented Dec 5, 2023

@crazycs520: 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 unit-test

The following commands are available to trigger optional jobs:

  • /test canary-notify-when-compatibility-sections-changed
  • /test pingcap/tidb/canary_ghpr_unit_test
  • /test pull-br-integration-test
  • /test pull-common-test
  • /test pull-e2e-test
  • /test pull-integration-common-test
  • /test pull-integration-copr-test
  • /test pull-integration-ddl-test
  • /test pull-integration-jdbc-test
  • /test pull-integration-mysql-test
  • /test pull-integration-nodejs-test
  • /test pull-lightning-integration-test
  • /test pull-mysql-client-test
  • /test pull-sqllogic-test
  • /test pull-tiflash-test

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

  • pingcap/tidb/canary_ghpr_unit_test
  • pingcap/tidb/ghpr_build
  • pingcap/tidb/ghpr_check
  • pingcap/tidb/ghpr_check2
  • pingcap/tidb/ghpr_mysql_test
  • pingcap/tidb/ghpr_unit_test

In response to this:

/test tiprow_fast_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/test-infra repository.

Copy link

ti-chi-bot bot commented Dec 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benmaoer, easonn7, you06, zyguan

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

@ti-chi-bot ti-chi-bot bot added the lgtm label Dec 5, 2023
@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 5, 2023
Copy link

ti-chi-bot bot commented Dec 5, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-04 03:45:34.998109705 +0000 UTC m=+1412763.663335924: ☑️ agreed by you06.
  • 2023-12-05 02:47:56.405036889 +0000 UTC m=+1495705.070263083: ☑️ agreed by zyguan.

@crazycs520
Copy link
Contributor Author

/retest-required

Copy link

tiprow bot commented Dec 5, 2023

@crazycs520: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tiprow_fast_test 34836c6 link true /test tiprow_fast_test

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.

@ti-chi-bot ti-chi-bot bot merged commit 6492800 into pingcap:master Dec 5, 2023
15 of 16 checks passed
@crazycs520 crazycs520 deleted the tidb_idle_transaction_timeout branch December 5, 2023 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support idle transaction timeout
5 participants