DM 启动时候 worker 报错,Found old binary log without GTIDs while looking for the oldest binary log that contains any GTID that is not in the given gtid set

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:v1.0.4
  • 【问题描述】: worker 启动时候报错

[2020/03/19 17:42:40.811 +08:00] [INFO] [relay.go:400] [“current master status”] [component=“relay log”] [position="(mysql-bin.000001, 120)"] [“GTID sets”=] [2020/03/19 17:42:40.821 +08:00] [ERROR] [relay.go:264] [“fail to close binlog event reader”] [component=“relay log”] [error="[code=10001:class=database:scope=upstream:level=high] kill connection 145 for master 192.168.1.12:3306: database driver error: Error 1094: Unknown thread id: 145"] [errorVerbose="[code=10001:class=database:scope=upstream:level=high] kill connection 145 for master 192.168.1.12:3306: database driver error: Error 1094: Unknown thread id: 145\ngithub.com/pingcap/dm/pkg/terror.(*Error).Delegate\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/terror/terror.go:267\ngithub.com/pingcap/dm/pkg/terror.DBErrorAdaptArgs\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/terror/adapter.go:39\ngithub.com/pingcap/dm/pkg/terror.DBErrorAdapt\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/terror/adapter.go:46\ngithub.com/pingcap/dm/pkg/utils.KillConn\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/utils/db.go:356\ngithub.com/pingcap/dm/pkg/binlog/reader.(*TCPReader).Close\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/binlog/reader/tcp.go:131\ngithub.com/pingcap/dm/relay/reader.(*reader).Close\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/relay/reader/reader.go:126\ngithub.com/pingcap/dm/relay.(*Relay).process.func1\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/relay/relay.go:262\ngithub.com/pingcap/dm/relay.(*Relay).process\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/relay/relay.go:296\ngithub.com/pingcap/dm/relay.(*Relay).Process\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/relay/relay.go:191\ngithub.com/pingcap/dm/dm/worker.(*realRelayHolder).run\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/relay.go:167\ngithub.com/pingcap/dm/dm/worker.(*realRelayHolder).Start.func1\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/relay.go:143\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357"] [2020/03/19 17:42:40.821 +08:00] [ERROR] [relay.go:194] [“process exit”] [component=“relay log”] [error="[code=30015:class=relay-unit:scope=upstream:level=high] TCPReader get relay event with error: ERROR 1236 (HY000): Found old binary log without GTIDs while looking for the oldest binary log that contains any GTID that is not in the given gtid set"] [errorVerbose="[code=30015:class=relay-unit:scope=upstream:level=high] TCPReader get relay event with error: ERROR 1236 (HY000): Found old binary log without GTIDs while looking for the oldest binary log that contains any GTID that is not in the given gtid set\ngithub.com/pingcap/dm/pkg/terror.(*Error).Delegate\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/terror/terror.go:267\ngithub.com/pingcap/dm/pkg/binlog/reader.(*TCPReader).GetEvent\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/binlog/reader/tcp.go:151\ngithub.com/pingcap/dm/relay/reader.(*reader).GetEvent\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/relay/reader/reader.go:144\ngithub.com/pingcap/dm/relay.(*Relay).handleEvents\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/relay/relay.go:382\ngithub.com/pingcap/dm/relay.(*Relay).process\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/relay/relay.go:292\ngithub.com/pingcap/dm/relay.(*Relay).Process\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/relay/relay.go:191\ngithub.com/pingcap/dm/dm/worker.(*realRelayHolder).run\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/relay.go:167\ngithub.com/pingcap/dm/dm/worker.(*realRelayHolder).Start.func1\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/relay.go:143\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357"] @

如上报错怀疑是mysql之前的binlog格式问题,现在我清理了mysql所有的binlog,并且也清理了对于worker中的relay_log文件,但是启动依然报这个错误。

若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

那 inventory 文件中的 relay_binlog_name / relay_binlog_gtid 你也修改了吗

没有修改那 dm-woker 还是会从 relay_binlog_name / relay_binlog_gtid 的值开始找的

改完了 deploy -l dm-woker 一下。看看好使不

你好,这个我的inventory 文件,里边没有relay_binlog_name / relay_binlog_gtid 这两个变量。 inventory.ini (1.3 KB)

我觉得你这个修复的几率不大,relay log你清掉了,上游mysql的binglog你也清掉了,建议重新部署,重新拉去吧,删除task任务中的meta-schema的值吧。重新拉去。

:+1: 建议重新部署再拉取 binlog 同步。

1赞

好的,从新部署已经解决了。

:+1::+1: