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

*: add execution retry time in slow log and slow_query and statement_summary (#19625) #20495

Merged
merged 6 commits into from
Oct 21, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #19625 to release-4.0


Signed-off-by: crazycs520 crazycs520@gmail.com

What problem does this PR solve?

Continue to the previous #19487.

This PR do 2 things:

  1. adds Exec_retry_time to indicate the time consuming on retry.
  • Exec_retry_time means the useless retry time consuming. Such retry 10 times, total exec_time is 10 seconds, the last successful execution time is 1 second, so the Exec_retry_time is 9 seconds. The last execution time can be found in the Plan field in the slow log.
# Time: 2020-08-31T17:43:07.162845+08:00
# Exec_retry_time: 1.337662279 Exec_retry_count: 2
# Query_time: 1.908441749
# Parse_time: 0.020197318
# Compile_time: 0.02073548
  1. adds exec_retry_count and exec_retry_time into system table statement_sammary:
information_schema> select DIGEST_TEXT,SUM_LATENCY,SUM_EXEC_RETRY_TIME,EXEC_COUNT,SUM_EXEC_RETRY from `STATEMENTS_SUMMARY` where SUM_EXEC_RETRY > 0;
+-------------------------------------------+--------------+---------------------+------------+----------------+
| DIGEST_TEXT                               | SUM_LATENCY  | SUM_EXEC_RETRY_TIME | EXEC_COUNT | SUM_EXEC_RETRY |
+-------------------------------------------+--------------+---------------------+------------+----------------+
| select * from t1 where a < ? for update ; | 381395110811 | 263244426899        | 130        | 257            |
+-------------------------------------------+--------------+---------------------+------------+----------------+

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Manual test

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM

Release note

  • Add execution retry time in slow log and slow_query.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor Author

/run-all-tests

executor/slow_query.go Outdated Show resolved Hide resolved
@crazycs520
Copy link
Contributor

@djshow832 @tangenta PTAL

@crazycs520
Copy link
Contributor

@tangenta @djshow832 PTAL

Copy link
Contributor

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 21, 2020
Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 21, 2020
@ti-srebot ti-srebot added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Oct 21, 2020
@crazycs520
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 21, 2020
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit dced64d into pingcap:release-4.0 Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/executor epic/slow-query sig/execution SIG execution sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants