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

DDL job always run.I can't kill it! #4986

Closed
7le opened this Issue Nov 2, 2017 · 11 comments

Comments

Projects
None yet
4 participants
@7le

7le commented Nov 2, 2017

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    Look at Id 46.I want to add a index,but the ddl job always run,I can't kill it.
tidb> admin show ddl jobs;
+------------------------------------------------------------------------------------------------------------------------------+---------+
| JOBS                                                                                                                         | STATE   |
+------------------------------------------------------------------------------------------------------------------------------+---------+
| ID:46, Type:add index, State:running, SchemaState:write reorganization, SchemaID:1, TableID:33, RowCount:165059980, ArgLen:0 | running |
| ID:47, Type:drop index, State:none, SchemaState:none, SchemaID:1, TableID:33, RowCount:0, ArgLen:0                           | none    |
| ID:48, Type:drop index, State:none, SchemaState:none, SchemaID:1, TableID:33, RowCount:0, ArgLen:0                           | none    |
| ID:45, Type:drop column, State:synced, SchemaState:none, SchemaID:1, TableID:33, RowCount:0, ArgLen:0                        | synced  |
| ID:44, Type:drop column, State:synced, SchemaState:none, SchemaID:1, TableID:33, RowCount:0, ArgLen:0                        | synced  |
| ID:43, Type:drop column, State:synced, SchemaState:none, SchemaID:1, TableID:33, RowCount:0, ArgLen:0                        | synced  |
| ID:42, Type:add column, State:synced, SchemaState:public, SchemaID:1, TableID:33, RowCount:0, ArgLen:0                       | synced  |
| ID:41, Type:add column, State:synced, SchemaState:public, SchemaID:1, TableID:33, RowCount:0, ArgLen:0                       | synced  |
| ID:40, Type:drop index, State:synced, SchemaState:none, SchemaID:1, TableID:33, RowCount:0, ArgLen:0                         | synced  |
| ID:39, Type:add column, State:synced, SchemaState:public, SchemaID:1, TableID:33, RowCount:0, ArgLen:0                       | synced  |
| ID:38, Type:add index, State:synced, SchemaState:public, SchemaID:1, TableID:33, RowCount:100283953, ArgLen:0                | synced  |
| ID:37, Type:drop table, State:synced, SchemaState:none, SchemaID:1, TableID:35, RowCount:0, ArgLen:0                         | synced  |
| ID:36, Type:create table, State:synced, SchemaState:public, SchemaID:1, TableID:35, RowCount:0, ArgLen:0                     | synced  |
+------------------------------------------------------------------------------------------------------------------------------+---------+
  1. What did you expect to see?
    I want the id 46 job success and stop.

  2. What did you see instead?
    The total number of my table is 100283953 , but the Id 46 job show RowCount:165059980. and the number still increase .

I want to kill it. But i can't find the session Id.

tidb> show processlist;
+------+------+---------------+------+---------+------+-------+------------------+
| Id   | User | Host          | db   | Command | Time | State | Info             |
+------+------+---------------+------+---------+------+-------+------------------+
|    2 | root | 127.0.0.1     | test | Query   |    0 | 2     | show processlist |
|    4 | root | 192.168.10.72 | test | Query   |    0 | 2     |                  |
+------+------+---------------+------+---------+------+-------+------------------+
2 rows in set (0.00 sec)

  1. What version of TiDB are you using (tidb-server -V)?
tidb> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                           |
+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v1.0.1-1-gaee0b39
Git Commit Hash: aee0b39af29c87742811f02c657dcf2b0fe1d60c
Git Branch: release-1.0
UTC Build Time: 2017-11-01 01:51:09 |
+----------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

@shenli

This comment has been minimized.

Member

shenli commented Nov 2, 2017

@7le Could you send me your tidb-server's log and the schema/ddl statement to shenli@pingcap.com?

@coocood

This comment has been minimized.

Member

coocood commented Nov 2, 2017

There is a cancel statement:

ADMIN CANCEL DDL JOBS 'job_id';

In this case, you can try:

ADMIN CANCEL DDL JOBS '46';
@coocood

This comment has been minimized.

Member

coocood commented Nov 2, 2017

And kill the session doesn't stop the DDL worker.

@7le

This comment has been minimized.

7le commented Nov 2, 2017

@coocood Thanks. I kill it successfully.

@7le

This comment has been minimized.

7le commented Nov 2, 2017

@shenli Thanks. The question is been resolved. So I don't send logs.

@812002343

This comment has been minimized.

812002343 commented Nov 2, 2017

OMG

@7le 7le closed this Nov 2, 2017

@shenli

This comment has been minimized.

Member

shenli commented Nov 2, 2017

@7le May I have the show create table your_table_name; of the table which you run AddIndex operation?

@7le

This comment has been minimized.

7le commented Nov 2, 2017

@shenli Of course. It's in the company's server. I will send you the table and the tidb-server's log tomorrow.

@shenli

This comment has been minimized.

Member

shenli commented Nov 2, 2017

@7le Thanks a lot!

@shenli

This comment has been minimized.

Member

shenli commented Nov 9, 2017

@7le The RowCount in Admin show ddl is not accurate in the previous version. This is fixed in #5041 . We will cherry-pick this patch to release-1.0 .

@7le

This comment has been minimized.

7le commented Nov 9, 2017

@shenli I got it . Thanks. 😃😃

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