[TiDB 版本]
v4.0.8
[DM版本]
v1.3.1
[问题描述]
用 dm 同步上游数据库到 mysql 的时候,遇到这个报错始终无法跳过,如下:
“errors”: [
{
“ErrCode”: 10006,
“ErrClass”: “database”,
“ErrScope”: “not-set”,
“ErrLevel”: “high”,
“Message”: “startLocation: [position: (, 0), gtid-set: ], endLocation: [position: (mysql-bin.001311, 253828172), gtid-set: b6e72963-f79a-11e8-a58e-bc3f8ff8605c:1-161155243,2f5ed759-54ea-11e8-8314-246e965f5e28:1,fa1932de-4baf-11ea-9a39-f875884a3c52:1-833451899,0778d74d-4bb0-11ea-a846-446a2e8b5372:1-4,2712b16c-54ea-11e8-8924-246e965f6be0:1-6,c42f1e56-b415-11e9-9b6f-f875884a3946:1-274069043,f73192cd-cb89-11e8-92e9-f875884a395c:1-8187722,a003b8d3-54eb-11e8-9eb6-f875884a3986:1-25767130,c67caf45-f79a-11e8-a02b-a0a33bc4c267:1-6676546,a889b6d1-54eb-11e8-880d-6c92bf48d024:1-142]: execute statement failed: REPLACE INTO insurance
.ins_distribute_gift_detail
(id
,distribute_code
,policy_num
,gift_detail
,remark
,created_at
,updated_at
,deleted_at
) VALUES (?,?,?,?,?,?,?,?)”,
“RawCause”: “Error 1048: Column ‘remark’ cannot be null”,
“Workaround”: “”
}
]
已知原始语句为 insert into 语句,切该字段在mysql中设置为 not null default ‘’。
dm worker程序的stdout日志如下:
[2021/01/25 17:11:44] [info] binlogsyncer.go:144 create BinlogSyncer with config {429546496 mysql 172.16.0.220 3306 dm_user false false false Asia/Shanghai true 0 30s 1m0s 1 true true 0}
[2021/01/25 17:11:44] [info] binlogsyncer.go:377 begin to sync binlog from GTID set a003b8d3-54eb-11e8-9eb6-f875884a3986:1-25767130,a889b6d1-54eb-11e8-880d-6c92bf48d024:1-142,fa1932de-4baf-11ea-9a39-f875884a3c52:1-833440376,f73192cd-cb89-11e8-92e9-f875884a395c:1-8187722,c67caf45-f79a-11e8-a02b-a0a33bc4c267:1-6676546,c42f1e56-b415-11e9-9b6f-f875884a3946:1-274069043,0778d74d-4bb0-11ea-a846-446a2e8b5372:1-4,b6e72963-f79a-11e8-a58e-bc3f8ff8605c:1-161155243,2712b16c-54ea-11e8-8924-246e965f6be0:1-6,2f5ed759-54ea-11e8-8314-246e965f5e28:1
[2021/01/25 17:11:44] [info] binlogsyncer.go:776 rotate to (mysql-bin.001311, 4)
[2021/01/25 17:11:47] [info] binlogsyncer.go:175 syncer is closing…
[2021/01/25 17:11:47] [error] binlogstreamer.go:77 close sync with err: sync is been closing…
[2021/01/25 17:11:47] [error] binlogsyncer.go:843 kill connection 55906198 error ERROR 1094 (HY000): Unknown thread id: 55906198
[2021/01/25 17:11:47] [info] binlogsyncer.go:849 kill last connection id 55906198
[2021/01/25 17:11:47] [info] binlogsyncer.go:202 syncer is closed
求解,困扰了我好几天了。
若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。