dm同步数据时为什么主从一直有间隔

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

  • 【TiDB 版本】:3.0.5
  • 【问题描述】: 数据同步的masterBinlog总是比syncerBinlog要大,即使上有数据库没有操作,也不会相同
"sync": {
                        "totalEvents": "18870",
                        "totalTps": "31",
                        "recentTps": "0",
                        "masterBinlog": "(db1m-bin.000046, 963757276)",
                        "masterBinlogGtid": "",
                        "syncerBinlog": "(db1m-bin|000001.000046, 963756062)",
                        "syncerBinlogGtid": "",
                        "blockingDDLs": [
                        ],
                        "unresolvedGroups": [
                        ],
                        "synced": false
                    }

你好,

根据 详细信息 目前无法判断是否存在同步延迟,pos 相差较少建议长时间观察一下。

由于后台Sync单元并不会实时刷新保存点,synced 为 “false“ 并不一定代表发生了同步延迟。

建议通过查询上下有数据比对,是否出现延迟。

看下以下链接是否能够帮助到你
https://pingcap.com/docs-cn/tidb-data-migration/stable/benchmark-v1.0-ga/

如何查看延时的时间?

详细信息如下。

query-status test_tidb
{
    "result": true,
    "msg": "",
    "workers": [
        {
            "result": true,
            "worker": "192.168.10.101:8265",
            "msg": "",
            "subTaskStatus": [
                {
                    "name": "test_tidb",
                    "stage": "Running",
                    "unit": "Sync",
                    "result": null,
                    "unresolvedDDLLockID": "",
                    "sync": {
                        "totalEvents": "26036",
                        "totalTps": "6",
                        "recentTps": "0",
                        "masterBinlog": "(db1m-bin.000046, 971753541)",
                        "masterBinlogGtid": "",
                        "syncerBinlog": "(db1m-bin|000001.000046, 971735370)",
                        "syncerBinlogGtid": "",
                        "blockingDDLs": [
                        ],
                        "unresolvedGroups": [
                        ],
                        "synced": false
                    }
                }
            ],
            "relayStatus": {
                "masterBinlog": "(db1m-bin.000046, 971753541)",
                "masterBinlogGtid": "",
                "relaySubDir": "07777bc0-9dd1-11e7-9d49-000c29652500.000001",
                "relayBinlog": "(db1m-bin.000046, 971753541)",
                "relayBinlogGtid": "00000000-0000-0000-0000-000000000000:0",
                "relayCatchUpMaster": true,
                "stage": "Running",
                "result": null
            },
            "sourceID": "mysql4"
        }
    ]
}

你好

尝试使用官网,多谢。
https://pingcap.com/docs-cn/tidb-data-migration/stable/monitor-a-dm-cluster/#binlog-replication

详细信息详解:
https://pingcap.com/docs-cn/tidb-data-migration/stable/query-status/#详情查询结果

查看监控并没有延迟,但实际使用中有些延迟,想量化延迟时间指标,还有其他方式吗?

你好,

目前只有官网介绍的方式来判断

1 个赞

好的,谢谢

:100:

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。