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: let select for update could be recorded for slow log and statements (#16743) #16885

Closed

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Apr 28, 2020

cherry-pick #16743 to release-3.1


What problem does this PR solve?

Problem Summary:
The pessimistic select for update statements could not be logged as slow query, also other things RecordSet.Close will do

What is changed and how it works?

Proposal: xxx

What's Changed:

Change the close function of chunkRowRecordSet

How it Works:

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)
    Start two sessions let the second select for update statement wait lock for sometime, the slow query should recorded like
# Conn_ID: 2
# Query_time: 8.580836624
# Parse_time: 0.000062642
# Compile_time: 0.000029461
# LockKeys_time: 8.580678652
# DB: test
# Is_internal: false
# Digest: 0cef963ebac4619e5a5c4562d83626a3abb5df2b0501a4dbeae157f7e5356cff
# Num_cop_tasks: 0
# Prepared: false
# Has_more_results: false
# Succ: true
# Plan: tidb_decode_plan('JIwwCTM2XzEJMAkxCXRhYmxlOnQxLCBoYW5kbGU6MiwgbG9jawo=')
# Plan_digest: 3f5625f5b5b7a079571f7844fe4e63a6587a0674dace590987cdb159574bdd22
select * from t1 where c1 = 2 for update;

Side effects

Release note

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 28, 2020

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants