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

server: wait for auto commit queries before shutdown #55494

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Aug 19, 2024

What problem does this PR solve?

Issue Number: close #55464

Problem Summary:

Previously, TiDB will not wait for auto-commit queries. These queries are directly killed. It'd be better to wait for them to finish.

What changed and how does it work?

Also checking the connection status when filtering the connection to wait.

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.

Run a workload with heavy auto-commit traffic, and you'll see the connections are closed with little leaked lock.

Release note

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 19, 2024
@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 Aug 19, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Aug 19, 2024
@YangKeao
Copy link
Member Author

YangKeao commented Aug 19, 2024

/hold

Testing now. It seems that it cannot fix the issue in my scenario.

@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 Aug 19, 2024
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 74.9624%. Comparing base (2045418) to head (cde8fe4).
Report is 26 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #55494        +/-   ##
================================================
+ Coverage   73.0142%   74.9624%   +1.9481%     
================================================
  Files          1576       1577         +1     
  Lines        440774     441528       +754     
================================================
+ Hits         321828     330980      +9152     
+ Misses        99264      90373      -8891     
- Partials      19682      20175       +493     
Flag Coverage Δ
integration 49.2033% <0.0000%> (?)
unit 71.8760% <40.0000%> (-0.2210%) ⬇️

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

Components Coverage Δ
dumpling 52.9567% <ø> (ø)
parser ∅ <ø> (∅)
br 52.5196% <ø> (+6.5224%) ⬆️

@YangKeao
Copy link
Member Author

/unhold

No problem. I made some mistakes while testing.

@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 Aug 20, 2024
Copy link

ti-chi-bot bot commented Aug 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, xhebox

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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 20, 2024
Copy link

ti-chi-bot bot commented Aug 20, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-19 08:16:12.135239316 +0000 UTC m=+166967.269689432: ☑️ agreed by Defined2014.
  • 2024-08-20 06:57:37.527612756 +0000 UTC m=+248652.662062877: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot merged commit c1c74b1 into pingcap:master Aug 20, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiDB will not wait for auto-commit statements during graceful shutdown
3 participants