DM Synchronization Exception from VIP

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: DM从VIP同步异常

| username: 等一分钟

[TiDB Usage Environment] Production Environment
[TiDB Version] 6.5.1
[Reproduction Path]
The source is MySQL master-slave
ip1: 10.10.10.1 Current binlog mysqld-bin.000010 60000
ip2: 10.10.10.2 Current binlog mysqld-bin.000020 80000
VIP: 10.10.10.3

DM synchronization connects to 10.10.10.3. After MySQL master-slave switch occurs, the binlog position changes, causing synchronization errors.
Can GTID solve this?

| username: h5n1 | Original post link

| username: TiDBer_小阿飞 | Original post link

If the VIP connected to the DM-worker needs to point to a new MySQL instance, follow these steps:

  1. Use the query-status command to get the GTID sets (syncerBinlogGtid) corresponding to the binlog that the current binlog replication processing unit has replicated downstream, denoted as gtid-S.
  2. On the MySQL instance to be switched to, use SELECT @@GLOBAL.gtid_purged; to get the GTID sets corresponding to the purged binlog, denoted as gtid-P.
  3. On the MySQL instance to be switched to, use SELECT @@GLOBAL.gtid_executed; to get the GTID sets corresponding to all successfully executed transactions, denoted as gtid-E.
  4. Ensure the following relationships are met; otherwise, switching the DM-worker connection to the respective MySQL instance is not supported:
    • gtid-S contains gtid-P (gtid-P can be empty)
    • gtid-E contains gtid-S
  5. Use the pause-task command to pause all running data migration tasks.
  6. Change the VIP to point to the new MySQL instance.
  7. Use the resume-task command to resume the previous data migration tasks.
    切换 DM-worker 与上游 MySQL 实例的连接 | PingCAP 文档中心
| username: 等一分钟 | Original post link

Thank you.

| username: 等一分钟 | Original post link

Thank you…

| username: Fly-bird | Original post link

Directly use the IP address?

| username: 等一分钟 | Original post link

Using cloud provider’s RDS.

| username: 等一分钟 | Original post link

  • On the MySQL instance you are about to switch to, use SELECT @@GLOBAL.gtid_purged; to get the GTID sets corresponding to the purged binlogs, referred to as gtid-P.

  • On the MySQL instance you are about to switch to, use SELECT @@GLOBAL.gtid_executed; to get the GTID sets corresponding to all successfully executed transactions, referred to as gtid-E.

If the instance you are about to switch to no longer exists and you cannot query SELECT @@GLOBAL.gtid_purged; or SELECT @@GLOBAL.gtid_executed, is there no way to proceed?

| username: 路在何chu | Original post link

Did you reset? Why can’t I find it?

| username: 等一分钟 | Original post link

Using Alibaba Cloud’s RDS high-availability version, after an OOM occurred, the original primary instance was destroyed and a new instance was started.

| username: 等一分钟 | Original post link

The image is not visible. Please provide the text you need translated.

| username: 等一分钟 | Original post link

After switching, this binlog does not exist on the new master, and it cannot be skipped.

| username: 等一分钟 | Original post link

  1. Use the resume-task command to resume the previous data migration task.
| username: 等一分钟 | Original post link

Is it my operation that is incorrect? After enabling GTID, it should no longer be related to the binlog file name and position, right?

| username: h5n1 | Original post link

Did you encounter an issue when enabling GTID?

| username: 等一分钟 | Original post link

Always on

| username: h5n1 | Original post link

If the binlog is lost, there will be gaps. It’s more reliable to reinitialize the data.

| username: 等一分钟 | Original post link

The binlog is not missing, it’s just that the binlog names on the primary and standby nodes are different. For example, the file currently synchronized on the primary node is mysql-bin.000509. After switching, there is no such file name as mysql-bin.000509 on the current primary node, but the data is synchronized.

| username: 芮芮是产品 | Original post link

You don’t understand anything, do you?

| username: 等一分钟 | Original post link

Please point out where the problem is.