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

admin show ddl jobs output confusing with multiple jobs #23494

Open
morgo opened this issue Mar 24, 2021 · 4 comments
Open

admin show ddl jobs output confusing with multiple jobs #23494

morgo opened this issue Mar 24, 2021 · 4 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/sql-infra SIG: SQL Infra type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@morgo
Copy link
Contributor

morgo commented Mar 24, 2021

Feature Request

Is your feature request related to a problem? Please describe:

Describe the feature you'd like:

I have 10 tables all trying to add an index concurrently (via sysbench):

mysql> show processlist;
+------+------+-----------+--------+---------+------+------------+--------------------------------+
| Id   | User | Host      | db     | Command | Time | State      | Info                           |
+------+------+-----------+--------+---------+------+------------+--------------------------------+
|   17 | root | localhost | sbtest | Query   |  672 | autocommit | CREATE INDEX k_9 ON sbtest9(k) |
|   19 | root | localhost | sbtest | Query   |  671 | autocommit | CREATE INDEX k_2 ON sbtest2(k) |
|   15 | root | localhost | sbtest | Query   |  672 | autocommit | CREATE INDEX k_8 ON sbtest8(k) |
|   23 | root | localhost | sbtest | Query   |  672 | autocommit | CREATE INDEX k_4 ON sbtest4(k) |
|   39 | root | localhost | NULL   | Query   |    0 | autocommit | show processlist               |
+------+------+-----------+--------+---------+------+------------+--------------------------------+
5 rows in set (0.00 sec)

mysql> admin show ddl jobs;
+--------+---------+------------+--------------+----------------------+-----------+----------+-----------+---------------------+---------------------+---------+
| JOB_ID | DB_NAME | TABLE_NAME | JOB_TYPE     | SCHEMA_STATE         | SCHEMA_ID | TABLE_ID | ROW_COUNT | START_TIME          | END_TIME            | STATE   |
+--------+---------+------------+--------------+----------------------+-----------+----------+-----------+---------------------+---------------------+---------+
|     79 | sbtest  | sbtest9    | add index    | write reorganization |        51 |       64 |    591104 | 2021-03-23 19:44:28 | NULL                | running |
|     80 | sbtest  | sbtest4    | add index    | none                 |        51 |       62 |         0 | 2021-03-23 19:44:28 | NULL                | none    |
|     81 | sbtest  | sbtest8    | add index    | none                 |        51 |       61 |         0 | 2021-03-23 19:44:29 | NULL                | none    |
|     82 | sbtest  | sbtest2    | add index    | none                 |        51 |       58 |         0 | 2021-03-23 19:44:29 | NULL                | none    |
|     78 | sbtest  | sbtest3    | add index    | public               |        51 |       57 |   1000001 | 2021-03-23 19:44:28 | 2021-03-23 19:55:14 | synced  |
|     77 | sbtest  | sbtest7    | add index    | public               |        51 |       60 |   1000001 | 2021-03-23 19:44:28 | 2021-03-23 19:53:28 | synced  |
|     76 | sbtest  | sbtest6    | add index    | public               |        51 |       56 |   1000001 | 2021-03-23 19:44:28 | 2021-03-23 19:51:40 | synced  |
|     75 | sbtest  | sbtest5    | add index    | public               |        51 |       59 |   1000001 | 2021-03-23 19:44:28 | 2021-03-23 19:49:54 | synced  |
|     74 | sbtest  | sbtest1    | add index    | public               |        51 |       55 |   1000001 | 2021-03-23 19:44:26 | 2021-03-23 19:48:33 | synced  |
|     73 | sbtest  | sbtest10   | add index    | public               |        51 |       53 |   1000001 | 2021-03-23 19:44:24 | 2021-03-23 19:46:29 | synced  |
|     72 | sbtest  | sbtest9    | create table | public               |        51 |       64 |         0 | 2021-03-23 19:42:46 | 2021-03-23 19:42:47 | synced  |
|     71 | sbtest  | sbtest4    | create table | public               |        51 |       62 |         0 | 2021-03-23 19:42:46 | 2021-03-23 19:42:47 | synced  |
|     70 | sbtest  | sbtest8    | create table | public               |        51 |       61 |         0 | 2021-03-23 19:42:46 | 2021-03-23 19:42:47 | synced  |
|     69 | sbtest  | sbtest7    | create table | public               |        51 |       60 |         0 | 2021-03-23 19:42:46 | 2021-03-23 19:42:47 | synced  |
+--------+---------+------------+--------------+----------------------+-----------+----------+-----------+---------------------+---------------------+---------+
14 rows in set (0.00 sec)

There are two confusing parts to this output:

  • START_TIME is the time the job was first created, not the time it actually started (because of queueing).
  • The STATE of none for the queued jobs would be easier to understand if it said "queueing" or "blocked".

Describe alternatives you've considered:

These are not technically bugs. They should in theory be improved when concurrent DDL is possible, but even with concurrent I expect there will be some maximum concurrency and hence improving still helps.

Teachability, Documentation, Adoption, Migration Strategy:

N/A

@morgo morgo added the type/feature-request Categorizes issue or PR as related to a new feature. label Mar 24, 2021
@morgo morgo added the sig/sql-infra SIG: SQL Infra label Mar 24, 2021
@zimulala
Copy link
Contributor

Currently START_TIME true meaning may be CREATE_TIME. I think a new field can be added.

@zimulala zimulala added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Mar 26, 2021
@Howie59
Copy link
Contributor

Howie59 commented Apr 6, 2021

/assign

@AilinKid
Copy link
Contributor

/assign

Need any help~?

@Howie59
Copy link
Contributor

Howie59 commented Apr 23, 2021

/assign

Need any help~?

i refer 2 draft, but i don't know right or wrong?
1
2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/sql-infra SIG: SQL Infra type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
4 participants