Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiDB V7.2.0 建分区表问题
[TiDB Usage Environment] Testing
[TiDB Version] V7.2.0
[Reproduction Path]
[Encountered Problem: Problem Phenomenon and Impact] After creating a partitioned table, it gets stuck, and all subsequent DDL operations cannot proceed. Using admin cancel ddl jobs to cancel the DDL job doesn’t work either. Restarting TiDB doesn’t help. Please help!!!
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]
Go to TiDB and check the logs to see what output is there.
Okay, let me take a look.
[2023/10/18 16:34:11.891 +08:00] [INFO] [ddl_worker.go:238] [“[ddl] add DDL jobs”] [“batch count”=1] [jobs=“ID:4048, Type:create table, State:queueing, SchemaState:none, SchemaID:94, TableID:4047, RowCount:0, ArgLen:2, start time: 2023-10-18 16:34:11.878 +0800 CST, Err:, ErrCount:0, SnapshotVersion:0; “] [table=true]
[2023/10/18 16:34:11.895 +08:00] [INFO] [ddl.go:1067] [”[ddl] start DDL job”] [job=“ID:4048, Type:create table, State:queueing, SchemaState:none, SchemaID:94, TableID:4047, RowCount:0, ArgLen:2, start time: 2023-10-18 16:34:11.878 +0800 CST, Err:, ErrCount:0, SnapshotVersion:0”] [query=“create table wlb(x int)”]
[2023/10/18 16:30:31.316 +08:00] [INFO] [domain.go:2988] [“refreshServerIDTTL succeed”] [serverID=3174839] [“lease id”=42b78b3e65b9b78a]
[2023/10/18 16:34:11.854 +08:00] [INFO] [session.go:3874] [“CRUCIAL OPERATION”] [conn=6981544793633456153] [schemaVersion=314] [cur_db=morse] [sql=“create table wlb(x int)”] [user=root@%]
[2023/10/18 16:34:11.891 +08:00] [INFO] [ddl_worker.go:238] [“[ddl] add DDL jobs”] [“batch count”=1] [jobs=“ID:4048, Type:create table, State:queueing, SchemaState:none, SchemaID:94, TableID:4047, RowCount:0, ArgLen:2, start time: 2023-10-18 16:34:11.878 +0800 CST, Err:, ErrCount:0, SnapshotVersion:0; “] [table=true]
[2023/10/18 16:34:11.895 +08:00] [INFO] [ddl.go:1067] [”[ddl] start DDL job”] [job=“ID:4048, Type:create table, State:queueing, SchemaState:none, SchemaID:94, TableID:4047, RowCount:0, ArgLen:2, start time: 2023-10-18 16:34:11.878 +0800 CST, Err:, ErrCount:0, SnapshotVersion:0”] [query=“create table wlb(x int)”]
[2023/10/18 16:35:11.872 +08:00] [WARN] [expensivequery.go:145] [expensive_query] [cost_time=60.018494686s] [conn=6981544793633456153] [user=root] [database=morse] [txn_start_ts=0] [mem_max=“0 Bytes (0 Bytes)”] [sql=“create table wlb(x int)”]
[2023/10/18 16:35:31.272 +08:00] [INFO] [domain.go:2988] [“refreshServerIDTTL succeed”] [serverID=3174839] [“lease id”=42b78b3e65b9b78a]
[2023/10/18 16:36:11.970 +08:00] [WARN] [expensivequery.go:145] [expensive_query] [cost_time=120.117141706s] [conn=6981544793633456153] [user=root] [database=morse] [txn_start_ts=0] [mem_max=“0 Bytes (0 Bytes)”] [sql=“create table wlb(x int)”]
[2023/10/18 16:36:21.343 +08:00] [WARN] [collate.go:221] [“The collation utf8mb4_0900_ai_ci specified on connection is not supported when new collation is enabled, switch to the default collation: utf8mb4_bin”]
[2023/10/18 16:36:40.802 +08:00] [WARN] [session.go:2220] [“compile SQL failed”] [conn=6981544793633456151] [error=“[schema:1146]Table ‘performance_schema.threads’ doesn’t exist”] [SQL=“SELECT st.* FROM performance_schema.events_statements_current st JOIN performance_schema.threads thr ON thr.thread_id = st.thread_id WHERE thr.processlist_id = 31”]
[2023/10/18 16:36:40.802 +08:00] [INFO] [conn.go:1199] [“command dispatched failed”] [conn=6981544793633456151] [connInfo=“id:6981544793633456151, addr:192.168.20.14:64680 status:10, collation:utf8mb4_0900_ai_ci, user:root”] [command=Query] [status=“inTxn:0, autocommit:1”] [sql=“SELECT st.* FROM performance_schema.events_statements_current st JOIN performance_schema.threads thr ON thr.thread_id = st.thread_id WHERE thr.processlist_id = 31”] [txn_mode=PESSIMISTIC] [timestamp=0] [err=“[schema:1146]Table ‘performance_schema.threads’ doesn’t exist”]
[2023/10/18 16:36:40.812 +08:00] [WARN] [session.go:2220] [“compile SQL failed”] [conn=6981544793633456151] [error=“[schema:1146]Table ‘performance_schema.events_waits_history_long’ doesn’t exist”] [SQL=“SELECT st.* FROM performance_schema.events_waits_history_long st WHERE st.nesting_event_id = 0”]
[2023/10/18 16:36:40.812 +08:00] [INFO] [conn.go:1199] [“command dispatched failed”] [conn=6981544793633456151] [connInfo=“id:6981544793633456151, addr:192.168.20.14:64680 status:10, collation:utf8mb4_0900_ai_ci, user:root”] [command=Query] [status=“inTxn:0, autocommit:1”] [sql=“SELECT st.* FROM performance_schema.events_waits_history_long st WHERE st.nesting_event_id = 0”] [txn_mode=PESSIMISTIC] [timestamp=0] [err=“[schema:1146]Table ‘performance_schema.events_waits_history_long’ doesn’t exist”]
[2023/10/18 16:37:12.071 +08:00] [WARN] [expensivequery.go:145] [expensive_query] [cost_time=180.218026031s] [conn=6981544793633456153] [user=root] [database=morse] [txn_start_ts=0] [mem_max=“0 Bytes (0 Bytes)”] [sql=“create table wlb(x int)”]
[2023/10/18 16:38:12.171 +08:00] [WARN] [expensivequery.go:145] [expensive_query] [cost_time=240.317375073s] [conn=6981544793633456153] [user=root] [database=morse] [txn_start_ts=0] [mem_max=“0 Bytes (0 Bytes)”] [sql=“create table wlb(x int)”]
Restart all TiDB servers with the command:
tiup cluster restart tidb-test -R tidb
Thank you, I’ll give it a try.
Restart everything, it looks like your issue from September 26 is still stuck.
Restarting didn’t work either.
Can stop, wait for a while, then start again.
Sure, it’s a test environment, I’ll give it a try.
Stopped for 15 minutes, and it’s still the same after getting up.
Is the admin show ddl
still the same as before?
Is it still not possible to perform any DDL operations?
You executed a new one, what does it show in the logs?
Regarding the log information on the 4th and 5th floors above
Restarting the cluster didn’t help either.
The reboot method doesn’t work anymore, and I’m out of ideas 
Could it still be a bug…