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

executor: add lock time in total time of insert execution info #52211

Merged
merged 2 commits into from Mar 30, 2024

Conversation

jackysp
Copy link
Member

@jackysp jackysp commented Mar 28, 2024

What problem does this PR solve?

Issue Number: close #52174

Problem Summary:
For no delayed DML execution (insert/update/delete), the query locks keys after execution, which make the lock duration be excluded in the total execution time. But for select for update statement, it is included.

What changed and how does it work?

Add the lock duration to execution info for pessimistic DMLs.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  1. start a cluster
  2. make an insert statement wait lock for a long time, like Lock RPC time does not include in execution info and slow query log #52174 shows.
  3. decode the insert plan in the slow log file
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: Jack Yu <jackysp@gmail.com>
@ti-chi-bot ti-chi-bot bot added release-note-none size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 28, 2024
@jackysp jackysp requested a review from zyguan March 28, 2024 12:33
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Merging #52211 (22c7e1a) into master (9104291) will increase coverage by 2.0282%.
Report is 19 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52211        +/-   ##
================================================
+ Coverage   70.6776%   72.7059%   +2.0282%     
================================================
  Files          1489       1495         +6     
  Lines        440013     444577      +4564     
================================================
+ Hits         310991     323234     +12243     
+ Misses       109483     101016      -8467     
- Partials      19539      20327       +788     
Flag Coverage Δ
integration 49.1111% <100.0000%> (?)
unit 70.4459% <100.0000%> (-0.0395%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 51.1232% <ø> (+5.3376%) ⬆️

Signed-off-by: Jack Yu <jackysp@gmail.com>
Copy link

ti-chi-bot bot commented Mar 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: you06, zyguan

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

ti-chi-bot bot commented Mar 29, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-28 12:47:21.105838177 +0000 UTC m=+2158468.128084550: ☑️ agreed by zyguan.
  • 2024-03-29 07:49:21.014679817 +0000 UTC m=+2226988.036926200: ☑️ agreed by you06.

@jackysp
Copy link
Member Author

jackysp commented Mar 29, 2024

/retest

1 similar comment
@jackysp
Copy link
Member Author

jackysp commented Mar 30, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit 2cc964d into pingcap:master Mar 30, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lock RPC time does not include in execution info and slow query log
3 participants