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

TRUNCATE PARTITION ALL gets stuck, ddl_worker retries, error returned #22704

Closed
zhangysh1995 opened this issue Feb 3, 2021 · 3 comments · Fixed by #23040
Closed

TRUNCATE PARTITION ALL gets stuck, ddl_worker retries, error returned #22704

zhangysh1995 opened this issue Feb 3, 2021 · 3 comments · Fixed by #23040
Assignees
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@zhangysh1995
Copy link

zhangysh1995 commented Feb 3, 2021

Bug Report

1. Minimal reproduce step (Required)

create table t (a int primary key) partition by hash (a);
alter table t truncate partition all;

2. What did you expect to see? (Required)

Speed up execution and return understandable error messages. Now it runs for several minutes (5min+) and fails.

3. What did you see instead (Required)

[2021/02/03 10:27:26.695 +00:00] [INFO] [error.go:25] ["ERROR 1735: DDL JOB ROLLBACK, ERROR MSG: UNKNOWN PARTITION 'DROP?' IN TABLE 'TABLE_5
_BINARY_2'"]

You should be able to see log like the following:

[2021/02/03 11:32:00.966 +00:00] [ERROR] [ddl_worker.go:720] ["[ddl] run DDL job error"] [worker="worker 3, tp general"] [error="[table:1735]Unknown partition 'drop?' in table 'table_5_binary_4'"]
[2021/02/03 11:32:00.975 +00:00] [INFO] [ddl_worker.go:499] ["[ddl] run DDL job failed, sleeps a while then retries it."] [worker="worker 3, tp general"] [waitTime=1s] [error="[table:1735]Unknown partition 'drop?' in table 'table_5_binary_4'"]
[2021/02/03 11:32:01.975 +00:00] [INFO] [ddl_worker.go:774] ["[ddl] schema version doesn't change"] [worker="worker 3, tp general"]
[2021/02/03 11:32:01.976 +00:00] [INFO] [ddl_worker.go:599] ["[ddl] run DDL job"] [worker="worker 3, tp general"] [job="ID:1198, Type:truncate partition, State:running, SchemaState:none, SchemaID:1190, TableID:1192, RowCount:0, ArgLen:0, start time: 2021-02-03 11:31:09.291 +0000 UTC, Err:[table:1735]Unknown partition 'drop?' in table 'table_5_binary_4', ErrCount:52, SnapshotVersion:0"]
[2021/02/03 11:32:01.978 +00:00] [ERROR] [ddl_worker.go:720] ["[ddl] run DDL job error"] [worker="worker 3, tp general"] [error="[table:1735]Unknown partition 'drop?' in table 'table_5_binary_4'"]
[2021/02/03 11:32:01.986 +00:00] [INFO] [ddl_worker.go:499] ["[ddl] run DDL job failed, sleeps a while then retries it."] [worker="worker 3, tp general"] [waitTime=1s] [error="[table:1735]Unknown partition 'drop?' in table 'table_5_binary_4'"]

4. What is your TiDB version? (Required)

-----------------------------------+
| Release Version: v5.0.0-rc
Edition: Community
Git Commit Hash: fd4437dde445012f5b75e5d4f336433cb076c1ee
Git Branch: heads/refs/tags/v5.0.0-rc
UTC Build Time: 2021-01-12 06:00:03
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@zhangysh1995 zhangysh1995 added the type/bug The issue is confirmed as a bug. label Feb 3, 2021
@zhangysh1995 zhangysh1995 changed the title TRUNCATE PARTITION ALL get stuck with ddl_worker retried to return error TRUNCATE PARTITION ALL gets stuck, ddl_worker retries, error returned Feb 3, 2021
@zyguan zyguan added the sig/DDL label Feb 3, 2021
@wjhuang2016 wjhuang2016 added sig/sql-infra SIG: SQL Infra and removed sig/DDL labels Feb 3, 2021
@AndrewDi
Copy link
Contributor

AndrewDi commented Feb 9, 2021

/pick-up

@ti-challenge-bot
Copy link

It is not a pickable issue!

Details

Tip : If you want this issue to be picked, you need to add a challenge-program label to it.

Warning: None

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
6 participants