-
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
server: add hooks to wait for background commit goroutines #55608
Conversation
d2cfbf3
to
7c4c2b6
Compare
7c4c2b6
to
4dc340c
Compare
/hold
|
4dc340c
to
b126ae0
Compare
b126ae0
to
0660748
Compare
1d810f9
to
bd33e80
Compare
/unhold |
bd33e80
to
20d1887
Compare
1bfb69b
to
8ee42a8
Compare
/retest |
1 similar comment
/retest |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #55608 +/- ##
================================================
+ Coverage 73.4160% 75.4990% +2.0830%
================================================
Files 1623 1623
Lines 447913 448314 +401
================================================
+ Hits 328840 338473 +9633
+ Misses 98931 89312 -9619
- Partials 20142 20529 +387
Flags with carried forward coverage won't be shown. Click here to find out more.
|
8ee42a8
to
4f6e6f5
Compare
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.
rest LGTM
pkg/session/session.go
Outdated
@@ -223,6 +223,9 @@ type session struct { | |||
sandBoxMode bool | |||
|
|||
cursorTracker cursor.Tracker | |||
|
|||
// Used to wait for all async commit background jobs to finish. | |||
asyncCommitWaitGroup sync.WaitGroup |
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.
May just name it commitWaitGroup
, because not only async-commit txns are tracked.
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-sigs/prow repository. |
95ed55b
to
ecae869
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, you06 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 |
[LGTM Timeline notifier]Timeline:
|
Signed-off-by: Yang Keao <[email protected]>
ecae869
to
7c9bd86
Compare
What problem does this PR solve?
Issue Number: close #55607
Problem Summary:
TiDB will leak some lock if the transaction is not committed/rollbacked successfully. The graceful shutdown routine didn't wait for the background async-commit (and secondary key lock cleanup) goroutines to finish, so it'd be better to also wait for them to avoid leaking the locks.
What changed and how does it work?
Use the hooks of the async-commit / secondary lock cleanup goroutines to track the lifecycle of them.
Check List
Tests
TODO
Side effects
Documentation
Release note