-
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
server: let select for update could be recorded for slow log and statements #16743
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16743 +/- ##
================================================
- Coverage 80.3228% 80.3142% -0.0087%
================================================
Files 507 507
Lines 137220 137358 +138
================================================
+ Hits 110219 110318 +99
- Misses 18334 18367 +33
- Partials 8667 8673 +6 |
Was it introduced by #15890 ? |
executor/adapter.go
Outdated
@@ -437,6 +438,12 @@ func (c *chunkRowRecordSet) NewChunk() *chunk.Chunk { | |||
} | |||
|
|||
func (c *chunkRowRecordSet) Close() error { | |||
c.execStmt.FinishExecuteStmt(c.execStmt.Ctx.GetSessionVars().TxnCtx.StartTS, true, false) |
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.
Can we extract the lines to a method in ExecStmt
?
LGTM |
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.
LGTM
/merge |
/run-all-tests |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
cherry pick to release-3.0 in PR #16884 |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
cherry pick to release-3.1 in PR #16885 |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
cherry pick to release-4.0 in PR #16886 |
cherry pick to release-4.0 in PR #16897 |
cherry pick to release-3.1 in PR #16901 |
cherry pick to release-3.0 in PR #16903 |
What problem does this PR solve?
Problem Summary:
The pessimistic
select for update
statements could not be logged as slow query, also other thingsRecordSet
.Close
will doWhat is changed and how it works?
Proposal: xxx
What's Changed:
Change the close function of
chunkRowRecordSet
How it Works:
Related changes
Check List
Tests
Start two sessions let the second select for update statement wait lock for sometime, the slow query should recorded like
Side effects
Release note