-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
txn: Add lock resolving to data_lock_waits #33993
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
61095ae
to
114b022
Compare
32c69f2
to
f8b6d88
Compare
@@ -2420,7 +2445,43 @@ func (r *dataLockWaitsTableRetriever) retrieve(ctx context.Context, sctx session | |||
|
|||
res = append(res, row) | |||
} | |||
for _, resolving := range r.resolvingLocks[resolvingStart:resolvingEnd] { |
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.
Better to add a test case to cover the optimistic lock situation.
executor/infoschema_reader.go
Outdated
@@ -2354,6 +2358,9 @@ func (r *dataLockWaitsTableRetriever) retrieve(ctx context.Context, sctx session | |||
digests[i] = hex.EncodeToString(digest) | |||
} | |||
} | |||
// note: for resolving locks, it's not possible or necessary to calculate |
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.
Dumb question: if it's an auto-commit statement, how shall we know what SQL it is?
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.
We can always join with tidb_trx on start_ts to get all sql executed in one transaction.
f8b6d88
to
04cca20
Compare
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/043b158bfe471282aed8bcaad844903cb868a855 |
@longfangsong |
Co-authored-by: ekexium <[email protected]>
Co-authored-by: cfzjywxk <[email protected]>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 243e056
|
TiDB MergeCI notify
|
What problem does this PR solve?
Issue Number: close #34609
Problem Summary:
What is changed and how it works?
Add optimisitc transaction's lock wait infomation by tracking lock resolving.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
⚠️ :DNM before we merge client-go#473 firstDone.