为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:
【TiDB 版本】
v4.0.10
【问题描述】
在为TPCH 生成的LINEITEM表的l_shipdate列建立索引时,使用 admin show ddl jobs 查看任务,发现该任务的ROW_COUNT 超过实际记录数,最终导致索引构建不成功
这是实际记录数
这是admin show ddl jobs的输出结果
若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。
为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:
【TiDB 版本】
v4.0.10
【问题描述】
在为TPCH 生成的LINEITEM表的l_shipdate列建立索引时,使用 admin show ddl jobs 查看任务,发现该任务的ROW_COUNT 超过实际记录数,最终导致索引构建不成功
这是实际记录数
这是admin show ddl jobs的输出结果
若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。
1.没有其他索引
表结构
索引建立语句
create index l_shipdate_idx on LINEITEM(L_SHIPDATE);
2.这是截取的部分tidb.log日志
[2021/01/27 13:36:45.697 +08:00] [INFO] [tidb.go:219] [“rollbackTxn for ddl/autocommit failed”]
[2021/01/27 13:36:45.697 +08:00] [WARN] [session.go:1123] [“run statement failed”] [conn=3] [schemaVersion=3035] [error=“[ddl:8214]Cancelled DDL job”] [session=“{
"currDBName": "tpch1",
"id": 3,
"status": 2,
"strictMode": true,
"user": {
"Username": "root",
"Hostname": "192.168.101.243",
"CurrentUser": false,
"AuthUsername": "root",
"AuthHostname": "%"
}
}”]
[2021/01/27 13:36:45.702 +08:00] [INFO] [conn.go:793] [“command dispatched failed”] [conn=3] [connInfo=“id:3, addr:192.168.101.243:14200 status:10, collation:utf8_general_ci, user:root”] [command=Query] [status=“inTxn:0, autocommit:1”] [sql=“create index l_shipdate_idx on LINEITEM(L_SHIPDATE)”] [txn_mode=PESSIMISTIC] [err=“[ddl:8214]Cancelled DDL job
github.com/pingcap/errors.AddStack
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20201126102027-b0a155152ca3/errors.go:174
github.com/pingcap/errors.Trace
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20201126102027-b0a155152ca3/juju_adaptor.go:15
github.com/pingcap/tidb/ddl.(*ddl).doDDLJob
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/ddl/ddl.go:523
github.com/pingcap/tidb/ddl.(*ddl).CreateIndex
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/ddl/ddl_api.go:4032
github.com/pingcap/tidb/executor.(*DDLExec).executeCreateIndex
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/executor/ddl.go:206
github.com/pingcap/tidb/executor.(*DDLExec).Next
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/executor/ddl.go:88
github.com/pingcap/tidb/executor.Next
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/executor/executor.go:262
github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelayExecutor
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/executor/adapter.go:520
github.com/pingcap/tidb/executor.(*ExecStmt).handleNoDelay
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/executor/adapter.go:402
github.com/pingcap/tidb/executor.(*ExecStmt).Exec
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/executor/adapter.go:355
github.com/pingcap/tidb/session.runStmt
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/session/tidb.go:308
github.com/pingcap/tidb/session.(*session).executeStatement
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/session/session.go:1120
github.com/pingcap/tidb/session.(*session).execute
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/session/session.go:1236
github.com/pingcap/tidb/session.(*session).Execute
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/session/session.go:1163
github.com/pingcap/tidb/server.(*TiDBContext).Execute
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/server/driver_tidb.go:248
github.com/pingcap/tidb/server.(*clientConn).handleQuery
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/server/conn.go:1374
github.com/pingcap/tidb/server.(*clientConn).dispatch
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/server/conn.go:1005
github.com/pingcap/tidb/server.(*clientConn).Run
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/server/conn.go:778
github.com/pingcap/tidb/server.(*Server).onConn
\t/home/jenkins/agent/workspace/tidb_v4.0.10/go/src/github.com/pingcap/tidb/server/server.go:439
runtime.goexit
\t/usr/local/go/src/runtime/asm_amd64.s:1357”]
[2021/01/27 13:36:51.716 +08:00] [INFO] [coprocessor.go:1034] [“[TIME_COP_WAIT] resp_time:896.5365ms txnStartTS:422504250949500929 region_id:24 store_addr:192.168.103.76:20160 kv_wait_ms:895”]
[2021/01/27 13:36:56.349 +08:00] [INFO] [coprocessor.go:1034] [“[TIME_COP_WAIT] resp_time:2.590554945s txnStartTS:422504251709718535 region_id:40 store_addr:192.168.103.60:20160 kv_wait_ms:2589”]
1 使用的是lightning local backend模式,lightning版本的是v4.0.3的,导入数据时TiDB集群版本是v4.0.0,导入数据之后使用TiUP将集群升级到v4.0.10
2 show table lineitem regions 的结果如下所示
regions.txt (20.5 KB)
我在做完
operator add merge-region 96628 98132
operator add split-region 98132 --policy=scan 操作后
使用 show table LINEITEM regions; 出现重复的region id
你可以过一会再查看一下,看起来是同一个region id,是否还存在。
此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。