TIDB对于100万数据建索引,提示连接超时

表:t
数据量:100万

mysql> create unique index ind_t1 on t (id1,type);
ERROR 2013 (HY000): Lost connection to MySQL server during query

  1. 什么版本
  2. dmesg 和 tidb.log 查看是否有OOM

版本:2.0.5 报错提示: 20/06/10 08:44:52.916 ddl_worker.go:342: [info] [ddl] run DDL job ID:215, Type:add index, State:running, SchemaState:write reorganization, SchemaID:183, TableID:210, RowCount:326018, ArgLen:0, start time: 2020-06-10 08:43:41.176 +0800 CST, Err:, ErrCount:0, SnapshotVersion:417267665345183746 2020/06/10 08:44:53.922 reorg.go:145: [info] [ddl] run reorg job wait timeout 1s, handled 326018 rows, current done handle 1401, err 2020/06/10 08:44:53.937 ddl_worker.go:445: [info] [ddl] schema version doesn’t change 2020/06/10 08:44:53.940 ddl_worker.go:342: [info] [ddl] run DDL job ID:215, Type:add index, State:running, SchemaState:write reorganization, SchemaID:183, TableID:210, RowCount:326018, ArgLen:0, start time: 2020-06-10 08:43:41.176 +0800 CST, Err:, ErrCount:0, SnapshotVersion:417267665345183746 2020/06/10 08:44:54.946 reorg.go:145: [info] [ddl] run reorg job wait timeout 1s, handled 326018 rows, current done handle 1401, err 2020/06/10 08:44:54.982 ddl_worker.go:445: [info] [ddl] schema version doesn’t change

麻烦上传完整sql,或者查看 是否有 GC life time is shorter 的报错

可以参考帖子