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: ddl jobs microsecond #52930

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Apr 26, 2024

What problem does this PR solve?

Issue Number: close #52929

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • 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.

The time columns in `information_schema.DDL_JOBS` now support microsecond information.

Test

Before:

mysql> SELECT JOB_ID,START_TIME,END_TIME,TIMEDIFF(END_TIME,START_TIME),TIMESTAMPDIFF(MICROSECOND,START_TIME,END_TIME),END_TIME=START_TIME,CONVERT(END_TIME USING utf8mb4) = CONVERT(START_TIME USING utf8mb4) FROM information_schema.DDL_JOBS ORDER BY TIMEDIFF(END_TIME,START_TIME) DESC LIMIT 20;
+--------+---------------------+---------------------+-------------------------------+------------------------------------------------+---------------------+---------------------------------------------------------------------+
| JOB_ID | START_TIME          | END_TIME            | TIMEDIFF(END_TIME,START_TIME) | TIMESTAMPDIFF(MICROSECOND,START_TIME,END_TIME) | END_TIME=START_TIME | CONVERT(END_TIME USING utf8mb4) = CONVERT(START_TIME USING utf8mb4) |
+--------+---------------------+---------------------+-------------------------------+------------------------------------------------+---------------------+---------------------------------------------------------------------+
|  10106 | 2024-04-26 11:20:02 | 2024-04-26 11:20:17 | 00:00:15                      |                                       15102000 |                   0 |                                                                   0 |
|  10108 | 2024-04-26 11:46:50 | 2024-04-26 11:47:05 | 00:00:15                      |                                       15069000 |                   0 |                                                                   0 |
|  10107 | 2024-04-26 11:45:41 | 2024-04-26 11:45:56 | 00:00:14                      |                                       14780000 |                   0 |                                                                   0 |
|   7455 | 2024-04-26 11:13:17 | 2024-04-26 11:13:17 | 00:00:00                      |                                          21000 |                   0 |                                                                   1 |
|   5105 | 2024-04-26 11:12:58 | 2024-04-26 11:12:58 | 00:00:00                      |                                          21000 |                   0 |                                                                   1 |
|   6653 | 2024-04-26 11:13:10 | 2024-04-26 11:13:10 | 00:00:00                      |                                          20000 |                   0 |                                                                   1 |
|   8723 | 2024-04-26 11:13:27 | 2024-04-26 11:13:27 | 00:00:00                      |                                          16000 |                   0 |                                                                   1 |
|   5877 | 2024-04-26 11:13:04 | 2024-04-26 11:13:04 | 00:00:00                      |                                          14000 |                   0 |                                                                   1 |
|   9125 | 2024-04-26 11:13:29 | 2024-04-26 11:13:29 | 00:00:00                      |                                          14000 |                   0 |                                                                   1 |
|   9959 | 2024-04-26 11:13:35 | 2024-04-26 11:13:35 | 00:00:00                      |                                          14000 |                   0 |                                                                   1 |
|   6767 | 2024-04-26 11:13:11 | 2024-04-26 11:13:11 | 00:00:00                      |                                          14000 |                   0 |                                                                   1 |
|   2851 | 2024-04-26 11:12:34 | 2024-04-26 11:12:34 | 00:00:00                      |                                          14000 |                   0 |                                                                   1 |
|   7679 | 2024-04-26 11:13:19 | 2024-04-26 11:13:19 | 00:00:00                      |                                          13000 |                   0 |                                                                   1 |
|   3953 | 2024-04-26 11:12:41 | 2024-04-26 11:12:41 | 00:00:00                      |                                          13000 |                   0 |                                                                   1 |
|   6267 | 2024-04-26 11:13:07 | 2024-04-26 11:13:07 | 00:00:00                      |                                          13000 |                   0 |                                                                   1 |
|   3579 | 2024-04-26 11:12:38 | 2024-04-26 11:12:38 | 00:00:00                      |                                          13000 |                   0 |                                                                   1 |
|   2455 | 2024-04-26 11:12:32 | 2024-04-26 11:12:32 | 00:00:00                      |                                          13000 |                   0 |                                                                   1 |
|   6149 | 2024-04-26 11:13:06 | 2024-04-26 11:13:06 | 00:00:00                      |                                          13000 |                   0 |                                                                   1 |
|   5491 | 2024-04-26 11:13:01 | 2024-04-26 11:13:01 | 00:00:00                      |                                          13000 |                   0 |                                                                   1 |
|   2863 | 2024-04-26 11:12:34 | 2024-04-26 11:12:34 | 00:00:00                      |                                          13000 |                   0 |                                                                   1 |
+--------+---------------------+---------------------+-------------------------------+------------------------------------------------+---------------------+---------------------------------------------------------------------+
20 rows in set (0.12 sec)

After:

mysql> SELECT JOB_ID,START_TIME,END_TIME,TIMEDIFF(END_TIME,START_TIME),TIMESTAMPDIFF(MICROSECOND,START_TIME,END_TIME),END_TIME=START_TIME,CONVERT(END_TIME USING utf8mb4) = CONVERT(START_TIME USING utf8mb4) FROM information_schema.DDL_JOBS ORDER BY TIMEDIFF(END_TIME,START_TIME) DESC LIMIT 20;
+--------+----------------------------+----------------------------+-------------------------------+------------------------------------------------+---------------------+---------------------------------------------------------------------+
| JOB_ID | START_TIME                 | END_TIME                   | TIMEDIFF(END_TIME,START_TIME) | TIMESTAMPDIFF(MICROSECOND,START_TIME,END_TIME) | END_TIME=START_TIME | CONVERT(END_TIME USING utf8mb4) = CONVERT(START_TIME USING utf8mb4) |
+--------+----------------------------+----------------------------+-------------------------------+------------------------------------------------+---------------------+---------------------------------------------------------------------+
|  10106 | 2024-04-26 11:20:02.297000 | 2024-04-26 11:20:17.399000 | 00:00:15                      |                                       15102000 |                   0 |                                                                   0 |
|  10108 | 2024-04-26 11:46:50.526000 | 2024-04-26 11:47:05.595000 | 00:00:15                      |                                       15069000 |                   0 |                                                                   0 |
|  10107 | 2024-04-26 11:45:41.498000 | 2024-04-26 11:45:56.278000 | 00:00:14                      |                                       14780000 |                   0 |                                                                   0 |
|   7455 | 2024-04-26 11:13:17.589000 | 2024-04-26 11:13:17.610000 | 00:00:00                      |                                          21000 |                   0 |                                                                   0 |
|   5105 | 2024-04-26 11:12:58.775000 | 2024-04-26 11:12:58.796000 | 00:00:00                      |                                          21000 |                   0 |                                                                   0 |
|   6653 | 2024-04-26 11:13:10.826000 | 2024-04-26 11:13:10.846000 | 00:00:00                      |                                          20000 |                   0 |                                                                   0 |
|   8723 | 2024-04-26 11:13:27.420000 | 2024-04-26 11:13:27.436000 | 00:00:00                      |                                          16000 |                   0 |                                                                   0 |
|   5877 | 2024-04-26 11:13:04.647000 | 2024-04-26 11:13:04.661000 | 00:00:00                      |                                          14000 |                   0 |                                                                   0 |
|   9125 | 2024-04-26 11:13:29.984000 | 2024-04-26 11:13:29.998000 | 00:00:00                      |                                          14000 |                   0 |                                                                   0 |
|   9959 | 2024-04-26 11:13:35.580000 | 2024-04-26 11:13:35.594000 | 00:00:00                      |                                          14000 |                   0 |                                                                   0 |
|   6767 | 2024-04-26 11:13:11.778000 | 2024-04-26 11:13:11.792000 | 00:00:00                      |                                          14000 |                   0 |                                                                   0 |
|   2851 | 2024-04-26 11:12:34.460000 | 2024-04-26 11:12:34.474000 | 00:00:00                      |                                          14000 |                   0 |                                                                   0 |
|   7679 | 2024-04-26 11:13:19.542000 | 2024-04-26 11:13:19.555000 | 00:00:00                      |                                          13000 |                   0 |                                                                   0 |
|   3953 | 2024-04-26 11:12:41.114000 | 2024-04-26 11:12:41.127000 | 00:00:00                      |                                          13000 |                   0 |                                                                   0 |
|   6267 | 2024-04-26 11:13:07.737000 | 2024-04-26 11:13:07.750000 | 00:00:00                      |                                          13000 |                   0 |                                                                   0 |
|   3579 | 2024-04-26 11:12:38.800000 | 2024-04-26 11:12:38.813000 | 00:00:00                      |                                          13000 |                   0 |                                                                   0 |
|   2455 | 2024-04-26 11:12:32.181000 | 2024-04-26 11:12:32.194000 | 00:00:00                      |                                          13000 |                   0 |                                                                   0 |
|   6149 | 2024-04-26 11:13:06.778000 | 2024-04-26 11:13:06.791000 | 00:00:00                      |                                          13000 |                   0 |                                                                   0 |
|   5491 | 2024-04-26 11:13:01.644000 | 2024-04-26 11:13:01.657000 | 00:00:00                      |                                          13000 |                   0 |                                                                   0 |
|   2863 | 2024-04-26 11:12:34.545000 | 2024-04-26 11:12:34.558000 | 00:00:00                      |                                          13000 |                   0 |                                                                   0 |
+--------+----------------------------+----------------------------+-------------------------------+------------------------------------------------+---------------------+---------------------------------------------------------------------+
20 rows in set (0.14 sec)

@dveeden dveeden requested a review from mjonss April 26, 2024 10:52
@ti-chi-bot ti-chi-bot bot added release-note size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 26, 2024
Copy link

tiprow bot commented Apr 26, 2024

Hi @dveeden. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dveeden
Copy link
Contributor Author

dveeden commented Apr 26, 2024

/ok-to-test

@dveeden
Copy link
Contributor Author

dveeden commented Apr 26, 2024

The only thing I don't understand is why TIMEDIFF(END_TIME,START_TIME) isn't returning microsecond info

Copy link
Contributor

@mjonss mjonss left a comment

Choose a reason for hiding this comment

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

LGTM.
Are there any risk of breaking existing usage of this table?

Copy link

ti-chi-bot bot commented Apr 26, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mjonss
Once this PR has been reviewed and has the lgtm label, please assign ywqzzy for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 Apr 26, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-26 11:14:35.736683931 +0000 UTC m=+10229.493819513: ☑️ agreed by mjonss.

@mjonss
Copy link
Contributor

mjonss commented Apr 26, 2024

Also is it possible to create either test for this, maybe an integration test and using --replace_regex to make sure there are a microsecond part?

@dveeden
Copy link
Contributor Author

dveeden commented Apr 26, 2024

LGTM.
Are there any risk of breaking existing usage of this table?

Not that I'm aware

Copy link

codecov bot commented Apr 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.6821%. Comparing base (10971ea) to head (1f79bbf).
Report is 28 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #52930         +/-   ##
=================================================
- Coverage   74.3919%   55.6821%   -18.7099%     
=================================================
  Files          1482       1596        +114     
  Lines        355545     605038     +249493     
=================================================
+ Hits         264497     336898      +72401     
- Misses        71785     244956     +173171     
- Partials      19263      23184       +3921     
Flag Coverage Δ
integration 37.5645% <100.0000%> (?)
unit 71.2285% <100.0000%> (-1.9185%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 49.9819% <ø> (+7.2343%) ⬆️

@dveeden
Copy link
Contributor Author

dveeden commented Apr 30, 2024

/retest

1 similar comment
@dveeden
Copy link
Contributor Author

dveeden commented Apr 30, 2024

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-1-more-lgtm ok-to-test release-note 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.

information_schema.DDL_JOBS improvements
2 participants