-
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
ttl: rollback the scan trasnaction even if the BEGIN
failed.
#58943
Conversation
/check-issue-triage-complete |
Signed-off-by: Yang Keao <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #58943 +/- ##
================================================
+ Coverage 73.1695% 73.5448% +0.3753%
================================================
Files 1678 1680 +2
Lines 464110 465025 +915
================================================
+ Hits 339587 342002 +2415
+ Misses 103656 102143 -1513
- Partials 20867 20880 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei, lcwangchao 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:
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
Wow! It's merged so fast. Amazing. |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #58900
Problem Summary:
Previously, the
RunInTxn
will only rollback the transaction after theBEGIN
runs successfully. However, if theBEGIN
is killed after setting the transaction status, it can still leave a valid transaction. We'll need to alsoROLLBACK
it.The effect is that when we are cancelling a TTL task (scaling the workers, stepping out of the TTL window, stopping the TTL function...), a session with valid transaction may pollute the session pool.
What changed and how does it work?
Move the
defer ... ROLLBACK
logic to the top of theRunInTxn
function.Check List
Tests
Release note