ITPub博客

首页 > 数据库 > NewSQL > TiDB DM同步报错ErrCode 44006处理一例

TiDB DM同步报错ErrCode 44006处理一例

原创 NewSQL 作者:chenfeng 时间:2022-05-16 10:27:15 0 删除 编辑

TiDB DM同步ErrCode  44006错误一般是由于源端做了DDL变更导致的。

报错信息如下:

# tiup dmctl --master-addr 192.168.1.1:8261 query-status test

tiup is checking updates for component dmctl ...

A new version of dmctl is available:

   The latest version:         v6.0.0

   Local installed version:    v5.4.0

   Update current component:   tiup update dmctl

   Update all components:      tiup update --all


Starting component `dmctl`: /root/.tiup/components/dmctl/v5.4.0/dmctl/dmctl /root/.tiup/components/dmctl/v5.4.0/dmctl/dmctl --master-addr 192.168.1.1:8261 query-status test

{

    "result": true,

    "msg": "",

    "sources": [

        {

            "result": true,

            "msg": "",

            "sourceStatus": {

                "source": "mysql-replica-01",

                "worker": "dm-192.168.1.1-8262",

                "result": null,

                "relayStatus": null

            },

            "subTaskStatus": [

                {

                    "name": "test",

                    "stage": "Paused",

                    "unit": "Sync",

                    "result": {

                        "isCanceled": false,

                        "errors": [

                            {

                                "ErrCode": 44006,

                                "ErrClass": "schema-tracker",

                                "ErrScope": "internal",

                                "ErrLevel": "high",

                                "Message": "startLocation: [position: (mysql-bin.000387, 175542807), gtid-set: 2ae5ff08-749b-11ec-b0b8-043f72e4f03a:1-3128394,57830545-209f-11ea-94cf-b8599fb677d0:1-92442922], endLocation: [position: (mysql-bin.000387, 175543234), gtid-set: 2ae5ff08-749b-11ec-b0b8-043f72e4f03a:1-3128394,57830545-209f-11ea-94cf-b8599fb677d0:1-92442923], origin SQL: [ALTER TABLE `test_agent`.`tesst_copy` \r\nCHANGE COLUMN `name1` `regionName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL AFTER `id`,\r\nCHANGE COLUMN `regionName` `countyName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL AFTER `regionName`]: cannot track DDL: ALTER TABLE `test_agent`.`tesst_copy` CHANGE COLUMN `name1` `regionName` VARCHAR(255) CHARACTER SET UTF8MB4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL AFTER `id`",

                                "RawCause": "[schema:1060]Duplicate column name 'regionName'",

                                "Workaround": ""

                            }

                        ],

                        "detail": null

                    },

                    "unresolvedDDLLockID": "",

                    "sync": {

                        "totalEvents": "18713",

                        "totalTps": "148",

                        "recentTps": "0",

                        "masterBinlog": "(mysql-bin.000387, 292993160)",

                        "masterBinlogGtid": "2ae5ff08-749b-11ec-b0b8-043f72e4f03a:1-3128394,57830545-209f-11ea-94cf-b8599fb677d0:1-92594451",

                        "syncerBinlog": "(mysql-bin.000387, 175542732)",

                        "syncerBinlogGtid": "2ae5ff08-749b-11ec-b0b8-043f72e4f03a:1-3128394,57830545-209f-11ea-94cf-b8599fb677d0:1-92442922",

                        "blockingDDLs": [

                        ],

                        "unresolvedGroups": [

                        ],

                        "synced": false,

                        "binlogType": "remote",

                        "secondsBehindMaster": "0"

                    }

                }

            ]

        }

    ]

}


从RDS端导出报错的表:

# mysqldump -h xxxxx.rds.aliyuncs.com -u root -p'xxxxxx'  --set-gtid-purged=OFF test_agent tesst_copy > tesst_copy.sql



TiDB端导入

# mysql -uroot -p123456 -h 192.168.1.3 -P 4000 < tesst_copy.sql


跳过错误:

# tiup dmctl --master-addr 192.168.1.1:8261 handle-error test skip 

tiup is checking updates for component dmctl ...

A new version of dmctl is available:

   The latest version:         v6.0.0

   Local installed version:    v5.4.0

   Update current component:   tiup update dmctl

   Update all components:      tiup update --all


Starting component `dmctl`: /root/.tiup/components/dmctl/v5.4.0/dmctl/dmctl /root/.tiup/components/dmctl/v5.4.0/dmctl/dmctl --master-addr 192.168.1.1:8261 handle-error test skip

{

    "result": true,

    "msg": "",

    "sources": [

        {

            "result": true,

            "msg": "",

            "source": "mysql-replica-01",

            "worker": "dm-192.168.1.1-8262"

        }

    ]

}


再次查看任务,已正常恢复同步:

# tiup dmctl --master-addr 192.168.1.1:8261 query-status test

tiup is checking updates for component dmctl ...

A new version of dmctl is available:

   The latest version:         v6.0.0

   Local installed version:    v5.4.0

   Update current component:   tiup update dmctl

   Update all components:      tiup update --all


Starting component `dmctl`: /root/.tiup/components/dmctl/v5.4.0/dmctl/dmctl /root/.tiup/components/dmctl/v5.4.0/dmctl/dmctl --master-addr 192.168.1.1:8261 query-status test

{

    "result": true,

    "msg": "",

    "sources": [

        {

            "result": true,

            "msg": "",

            "sourceStatus": {

                "source": "mysql-replica-01",

                "worker": "dm-192.168.1.1-8262",

                "result": null,

                "relayStatus": null

            },

            "subTaskStatus": [

                {

                    "name": "test",

                    "stage": "Running",

                    "unit": "Sync",

                    "result": null,

                    "unresolvedDDLLockID": "",

                    "sync": {

                        "totalEvents": "26165",

                        "totalTps": "694",

                        "recentTps": "0",

                        "masterBinlog": "(mysql-bin.000387, 294077175)",

                        "masterBinlogGtid": "2ae5ff08-749b-11ec-b0b8-043f72e4f03a:1-3128394,57830545-209f-11ea-94cf-b8599fb677d0:1-92594657",

                        "syncerBinlog": "(mysql-bin.000387, 175575178)",

                        "syncerBinlogGtid": "2ae5ff08-749b-11ec-b0b8-043f72e4f03a:1-3128394,57830545-209f-11ea-94cf-b8599fb677d0:1-92442942",

                        "blockingDDLs": [

                        ],

                        "unresolvedGroups": [

                        ],

                        "synced": false,

                        "binlogType": "remote",

                        "secondsBehindMaster": "240729"

                    }

                }

            ]

        }

    ]

}


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15498/viewspace-2894379/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
交流MySQL,PolarDB/PolarDB-X,PostgreSQL,MongoDB和Redis技术。

注册时间:2015-12-07

  • 博文量
    784
  • 访问量
    2689073