DM数据迁移同步时出现code=10006错误

为提高效率,提问时请尽量提供详细背景信息,问题描述清晰可优先响应。以下信息点请尽量提供:

  • 系统版本 & kernel 版本:CentOS Linux release 7.3.1611
  • TiDB 版本:3.0
  • 磁盘型号:
  • 集群节点分布:3kv+3pd+2tidb
  • 数据量 & region 数量 & 副本数:
  • 集群 QPS、.999-Duration、读写比例:
  • 问题描述(我做了什么):使用DM进行数据迁移时 Load状态下出现错误, { “Type”: “ExecSQL”, “msg”: “[code=10006:class=database:scope=downstream:level=high] file yx_log427.log_player_resource.000000104.sql: execute statement failed: USE yx_log427;: context canceledngithub.com/pingcap/dm/pkg/terror.(*Error).Delegate /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/terror/terror.go:267ngithub.com/pingcap/dm/pkg/baseconn.(*BaseConn).ExecuteSQLWithIgnoreError /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/baseconn/conn.go:179ngithub.com/pingcap/dm/pkg/baseconn.(*BaseConn).ExecuteSQL /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/baseconn/conn.go:194ngithub.com/pingcap/dm/loader.(*Conn).executeSQL.func2 /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/loader/db.go:120ngithub.com/pingcap/dm/pkg/retry.(*FiniteRetryStrategy).Apply /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/retry/strategy.go:71ngithub.com/pingcap/dm/pkg/baseconn.(*BaseConn).ApplyRetryStrategy /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/baseconn/conn.go:200ngithub.com/pingcap/dm/loader.(*Conn).executeSQL /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/loader/db.go:115ngithub.com/pingcap/dm/loader.(*Worker).run.func1 /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/loader/loader.go:158 runtime.goexit /usr/local/go/src/runtime/asm_amd64.s:1337” }, { “Type”: “ExecSQL”, “msg”: “[code=10006:class=database:scope=downstream:level=high] file yx_log60.log_player_resource.00001.sql: execute statement failed: INSERT INTO log_player_resource VALUES (1,‘2019-06-28 10:12:12’,1,2,62914561,‘孟雪曼’,60,0,NULL,NULL,NULL,‘0’,‘0’,‘2000’,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (2,‘2019-06-28 10:12:12’,1,4,62914561,‘孟雪曼’,60,0,NULL,NULL,NULL,‘0’,‘0’,‘5000’,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (3,‘2019-06-28 10:12:12’,1,3,62914561,‘孟雪曼’,60,0,NULL,NULL,NULL,‘0’,‘0’,‘2000’,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (4,‘2019-06-28 10:12:12’,1,11,62914561,‘孟雪曼’,60,1,NULL,NULL,NULL,‘0’,‘0’,‘10’,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (5,‘2019-06-28 10:12:15’,1,2,62914562,‘尹欣怡’,60,0,NULL,NULL,NULL,‘0’,‘0’,‘2000’,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (6,‘2019-06-28 10:12:15’,1,4,62914562,‘尹欣怡’,60,0,NULL,NULL,NULL,‘0’,‘0’,‘5000’,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (7,‘2019-06-28 10:12:15’,1,3,62914562,‘尹欣怡’,60,0,NULL,NULL,NULL,‘0’,‘0’,‘2000’,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (8,‘2019-06-28 10:12:15’,1,11,62914562,‘尹欣怡’,60,1,NULL,NULL,NULL,‘0’,‘0’,‘10’,NULL,NULL,N…: context canceledngithub.com/pingcap/dm/pkg/terror.(*Error).Delegate /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/terror/terror.go:267ngithub.com/pingcap/dm/pkg/baseconn.(*BaseConn).ExecuteSQLWithIgnoreError /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/baseconn/conn.go:179ngithub.com/pingcap/dm/pkg/baseconn.(*BaseConn).ExecuteSQL /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/baseconn/conn.go:194ngithub.com/pingcap/dm/loader.(*Conn).executeSQL.func2 /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/loader/db.go:120ngithub.com/pingcap/dm/pkg/retry.(*FiniteRetryStrategy).Apply /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/retry/strategy.go:71ngithub.com/pingcap/dm/pkg/baseconn.(*BaseConn).ApplyRetryStrategy /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/baseconn/conn.go:200ngithub.com/pingcap/dm/loader.(*Conn).executeSQL /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/loader/db.go:115ngithub.com/pingcap/dm/loader.(*Worker).run.func1 /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/loader/loader.go:158 runtime.goexit /usr/local/go/src/runtime/asm_amd64.s:1337” }, { “Type”: “ExecSQL”, “msg”: “[code=10006:class=database:scope=downstream:level=high] file yx_log60.log_player_resource.000000024.sql: execute statement failed: UPDATE dm_meta.test_loader_checkpoint SET offset=999954 WHERE id =‘mysql-replica-01’ AND filename=‘yx_log60.log_player_resource.000000024.sql’;: context canceledngithub.com/pingcap/dm/pkg/terror.(*Error).Delegate /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/terror/terror.go:267ngithub.com/pingcap/dm/pkg/baseconn.(*BaseConn).ExecuteSQLWithIgnoreError /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/baseconn/conn.go:179ngithub.com/pingcap/dm/pkg/baseconn.(*BaseConn).ExecuteSQL /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/baseconn/conn.go:194ngithub.com/pingcap/dm/loader.(*Conn).executeSQL.func2 /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/loader/db.go:120ngithub.com/pingcap/dm/pkg/retry.(*FiniteRetryStrategy).Apply /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/retry/strategy.go:71ngithub.com/pingcap/dm/pkg/baseconn.(*BaseConn).ApplyRetryStrategy /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/baseconn/conn.go:200ngithub.com/pingcap/dm/loader.(*Conn).executeSQL /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/loader/db.go:115ngithub.com/pingcap/dm/loader.(*Worker).run.func1 /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/loader/loader.go:158 runtime.goexit /usr/local/go/src/runtime/asm_amd64.s:1337” },

原因: 日志中可以看出是由于 insert 过程中出现失败,具体的日志报错需要看一下对应的 TIDB 日志才能判断是由于 SQL 解析报错 ? 还是其他比如网络原因导致的执行失败。 需求:

  1. 提供对应时间点的 TIDB 日志;
  2. 提供对应的 task 任务的配置文件。
  3. query-status 状态

你好,可以参考下我们上周刚整理的DM 错误含义和诊断 看看能不能有帮助。