DM同步报错 ERROR 1236 (HY000): Could not find first log file name in binary log index

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:
【 TiDB 使用环境】

【概述】 场景 + 问题概述

【备份和数据迁移策略逻辑】

【背景】 做过哪些操作

【现象】 业务和数据库现象

【问题】 当前遇到的问题

【业务影响】

【TiDB 版本】

【附件】

  • 相关日志、配置文件、Grafana 监控(https://metricstool.pingcap.com/)
  • TiUP Cluster Display 信息
  • TiUP CLuster Edit config 信息
  • TiDB-Overview 监控
  • 对应模块的 Grafana 监控(如有 BR、TiDB-binlog、TiCDC 等)
  • 对应模块日志(包含问题前后 1 小时日志)

同步报错日志:
subTaskStatus": [
{
“name”: “goods_prd_2_one_to_one”,
“stage”: “Paused”,
“unit”: “InvalidUnit”,
“result”: {
“isCanceled”: false,
“errors”: [
{
“Type”: “UnknownError”,
“msg”: “[code=22001:class=binlog-op:scope=internal:level=high] fail to initial unit Sync of subtask goods_prd_2_one_to_one : UUID suffix 000002 with UUIDs [c86eda43-d953-11eb-b282-1c34da49c7e8.000001] not found\ngithub.com/pingcap/dm/pkg/terror.(*Error).Generatef\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/terror/terror.go:237\ngithub.com/pingcap/dm/pkg/binlog.ExtractPos\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/binlog/position.go:109\ngithub.com/pingcap/dm/syncer.(*Syncer).setInitActiveRelayLog\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/syncer/relay.go:70\ngithub.com/pingcap/dm/syncer.(*Syncer).Init\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/syncer/syncer.go:409\ngithub.com/pingcap/dm/dm/worker.(*SubTask).Init\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/subtask.go:136\ngithub.com/pingcap/dm/dm/worker.(*SubTask).Run\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/subtask.go:179\ngithub.com/pingcap/dm/dm/worker.(*SubTask).Resume\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/subtask.go:446\ngithub.com/pingcap/dm/dm/worker.(*Worker).handleTask\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/worker.go:881\ngithub.com/pingcap/dm/dm/worker.(*Worker).Start.func1\n\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/worker.go:179\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357”,
“error”: null
}
],
“detail”: null
},
“unresolvedDDLLockID”: “”
}
],
“relayStatus”: {
“masterBinlog”: “(mysql-bin.018224, 266430212)”,
“masterBinlogGtid”: “0a677d25-c14b-11ea-9262-b8599faed194:1-13984,2c191dc7-9a72-11ea-974e-b8599faed194:1-6546,3c620931-175c-11ea-8085-5254005a27f3:15474-15481,44ce4e64-2258-11eb-a1d5-0c42a140e95a:1-143457005,5ad61b74-c1bf-11ea-9ff0-0c42a164b7bd:1-1228033810,5e312c1a-3a1d-11eb-836a-0c42a172a7c2:1-4716188238,7400dfb4-b470-11e5-a623-52540085cdaa:91561169-94298980,f2a8e27d-d8c0-11eb-9f6a-6c92bf62a86e:1-32212958,00393449-5521-11ea-934d-6c92bf620b6a:1-87080286,1e3c0ec6-28c0-11eb-b6b6-6c0b84d5a2f0:1-494145476,b914dad4-d9b8-11eb-8da6-6c92bf48d274:1-6211200050,cfe9d0e4-1b1b-11ea-98f6-6c92bf629ab2:1-27617593,dc0e21f3-1b1b-11ea-98f6-6c92bf6297d0:1-639802”,
“relaySubDir”: “c86eda43-d953-11eb-b282-1c34da49c7e8.000001”,
“relayBinlog”: “(mysql-bin.018224, 4)”,
“relayBinlogGtid”: “”,
“relayCatchUpMaster”: false,
“stage”: “Paused”,
“result”: {
“isCanceled”: false,
“errors”: [
{
“Type”: “UnknownError”,
“msg”: “[code=30015:class=relay-unit:scope=upstream:level=high] TCPReader get relay event with error: ERROR 1236 (HY000): Could not find first log file name in binary log index file\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”,
“error”: null
}
],
“detail”: null
}
},
“sourceID”: “s_pagoda_overall_prd_2”
}
]
}


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

中继日志中无相关binlog日志相关信息,开启同步任务就报错,dump和中继日志文件中未生成文件
[root@production.datamg.dm.02 relay_log]# cd c86eda43-d953-11eb-b282-1c34da49c7e8.000001/
[root@production.datamg.dm.02 c86eda43-d953-11eb-b282-1c34da49c7e8.000001]# ls
relay.meta
[root@production.datamg.dm.02 c86eda43-d953-11eb-b282-1c34da49c7e8.000001]# cat relay.meta
binlog-name = “”
binlog-pos = 4
binlog-gtid = “”

  1. 请问上游是 MySQL 吗? 什么版本?
  2. DM 和 TiDB 集群是什么版本?
  3. DM 开启了 relay log 吗? 如果是的话,可以检查下是否有权限从上游拉取binlog文件。

上游MySQL 是腾讯云MySQL5.7。
DMv1.0.5,tidb集群v3.0.14。
DM开启了relay log。
原来DM同步任务也是报以上错误,将原来的任务删除后,重新启用DM同步任务,还是报这个错误。

  1. 请问是使用什么方式部署的 DM?
  2. 可以参考文档看下配置是否正确 https://docs.pingcap.com/zh/tidb-data-migration/v1.0/relay-log#初始迁移规则
  3. 检查下权限是否满足 https://docs.pingcap.com/zh/tidb-data-migration/v1.0/dm-worker-intro/#dm-worker-所需权限