使用dm 从Mariadb 增量至Tidb 报错:ErrorCode 36069

【 TiDB 使用环境】测试
【 TiDB 版本】v7.1.1
【复现路径】从Mariadb 增量迁移至 Tidb
【遇到的问题:问题现象及影响】 通过DM创建Task,增量迁移至 tidb报错。
【资源配置】*进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts)

task 配置的数据源

配置数据源

mysql-instances:

  • source-id: “mariadb-01”
    block-allow-list: “bw-rule-1”
    meta:
    binlog-name: “log-bin.015032”
    binlog-pos: 34134716
    binlog-gtid: “0-13-41472044”

metadata 信息:
Started dump at: 2023-09-05 14:14:47
SHOW MASTER STATUS:
Log: log-bin.015032
Pos: 34134716
GTID:0-13-41472044

Finished dump at: 2023-09-05 14:23:48

完整的报错信息:

 tiup dmctl --master-addr 10.0.20.46:8261 query-status task-mariadb-test1
tiup is checking updates for component dmctl ...
Starting component `dmctl`: /root/.tiup/components/dmctl/v7.3.0/dmctl/dmctl --master-addr 10.0.20.46:8261 query-status task-mariadb-test1
{
    "result": true,
    "msg": "",
    "sources": [
        {
            "result": true,
            "msg": "",
            "sourceStatus": {
                "source": "mariadb-01",
                "worker": "dm-10.0.20.46-8262",
                "result": null,
                "relayStatus": null
            },
            "subTaskStatus": [
                {
                    "name": "task-mariadb-test1",
                    "stage": "Paused",
                    "unit": "Sync",
                    "result": {
                        "isCanceled": false,
                        "errors": [
                            {
                                "ErrCode": 36069,
                                "ErrClass": "sync-unit",
                                "ErrScope": "upstream",
                                "ErrLevel": "high",
                                "Message": "get binlog event error: ERROR 1932 (42S02): Table 'mysql.gtid_slave_pos' doesn't exist in engine",
                                "RawCause": "",
                                "Workaround": "Please check if the binlog file could be parsed by `mysqlbinlog`."
                            }
                        ],
                        "detail": null
                    },
                    "unresolvedDDLLockID": "",
                    "sync": {
                        "totalEvents": "11",
                        "totalTps": "0",
                        "recentTps": "0",
                        "masterBinlog": "(log-bin.015032, 63672633)",
                        "masterBinlogGtid": "0-13-41499424",
                        "syncerBinlog": "(log-bin.015032, 34134716)",
                        "syncerBinlogGtid": "0-13-41472044",
                        "blockingDDLs": [
                        ],
                        "unresolvedGroups": [
                        ],
                        "synced": false,
                        "binlogType": "remote",
                        "secondsBehindMaster": "0",
                        "blockDDLOwner": "",
                        "conflictMsg": "",
                        "totalRows": "11",
                        "totalRps": "0",
                        "recentRps": "0"
                    },
                    "validation": null
                }
            ]
        }
    ]
}

Mariadb和mysql的gtid格式不一样,

https://docs.pingcap.com/zh/tidb/stable/dm-overview#使用限制

* MariaDB 版本 >= 10.1.2 (实验特性)

注意

如果上游 MySQL/MariaDB servers 间构成主从复制结构,则需要 MySQL 版本高于 5.7.1 或者 MariaDB 版本等于或高于 10.1.3。

MariaDB 的版本对吗?现在看上去像是binlog就没有办法解释,给出的建议是使用mysqlbinlog去尝试解析一下binlog。
可能和能识别的binlog格式就有较大的差异。比较难搞了。

1 个赞

版本兼容性

版本问题吧

先弄到mysql里,绕一下这个

把这部分去掉试试

binlog-gtid: “0-13-41472044”

task-mode是增量还是全量


MariaDB 兼容性还不是很好,你可以先MariaDB 到 mysql 搞个同步,然后 再从 mysql 同步到tidb,绕个圈