【 TiDB 使用环境】生产环境
【 TiDB 版本】8.5.1
【复现路径】
tidb负责同步上游mysql的数据。上游mysql为分表的order0,order1,order2,order3,同步到tidb的order库中
研发给order0.1库的表新增字段,
order0执行sql为:
ALTER TABLE t_order_$i MODIFY COLUMN mercode VARCHAR(80) NOT NULL DEFAULT ‘0’ COMMENT ‘渠道商户号’"
order1执行sql为:
ALTER TABLE posx_prd.t_order
MODIFY COLUMN mercode VARCHAR(80)
DEFAULT ‘0’ NOT NULL COMMENT ‘渠道商户号’
order0和order1对比差异
CHARACTER SET UTF8MB4
COLLATE utf8mb4_0900_ai_ci
导致 DM 在做 online DDL 一致性校验时失败。
【遇到的问题:问题现象及影响】
[tidb@monitor208 ~]$ tiup dmctl --master-addr 192.168.138.210:8261 query-status test1
A new version of dmctl is available: v8.5.1 → v8.5.6
To update this component: tiup update dmctl
To update all components: tiup update --all
Starting component dmctl: /home/tidb/.tiup/components/dmctl/v8.5.1/dmctl/dmctl --master-addr 192.168.138.210:8261 query-status test1
{
“result”: true,
“msg”: “”,
“sources”: [
{
“result”: true,
“msg”: “”,
“sourceStatus”: {
“source”: “wangpu-01”,
“worker”: “dm-192.168.138.212-8262”,
“result”: null,
“relayStatus”: null
},
“subTaskStatus”: [
{
“name”: “test1”,
“stage”: “Paused”,
“unit”: “Sync”,
“result”: {
“isCanceled”: false,
“errors”: [
{
“ErrCode”: 36008,
“ErrClass”: “sync-unit”,
“ErrScope”: “internal”,
“ErrLevel”: “high”,
“Message”: “startLocation: [position: (mysql-bin.003462, 451605667), gtid-set: b5082f3c-43e9-11ef-b134-0c42a1475886:1-2189273137:2189273139-2192077573], endLocation: [position: (mysql-bin.003462, 451605937), gtid-set: b5082f3c-43e9-11ef-b134-0c42a1475886:1-2189273137:2189273139-2192077574], origin SQL: [/* ApplicationName=DBeaver 22.3.4 - SQLEditor \u003cScript-7.sql\u003e */ \r\nalter table t_order_1\r\n modify mercode varchar(80) default ‘0’ not null comment ‘渠道商户号’]: detect inconsistent DDL sequence from source [first-location: position: (mysql-bin.003462, 451605667), gtid-set: b5082f3c-43e9-11ef-b134-0c42a1475886:1-2189273137:2189273139-2192077573 ddls: [ALTER TABLE posx_prd.t_order MODIFY COLUMN mercode VARCHAR(80) DEFAULT ‘0’ NOT NULL COMMENT ‘渠道商户号’] source: posx_prd.t_order_1], right DDL sequence should be [first-location: position: (mysql-bin.003458, 238386347), gtid-set: b5082f3c-43e9-11ef-b134-0c42a1475886:1-2189273137 ddls: [ALTER TABLE posx_prd.t_order MODIFY COLUMN mercode VARCHAR(80) CHARACTER SET UTF8MB4 COLLATE utf8mb4_0900_ai_ci DEFAULT ‘0’ NOT NULL COMMENT ‘渠道商户号’] source: posx_prd.t_order_0]”,
“RawCause”: “”,
“Workaround”: “Please use show-ddl-locks command for more details.”
}
],
“detail”: null
},
“unresolvedDDLLockID”: “”,
“sync”: {
“totalEvents”: “523252”,
“totalTps”: “401”,
“recentTps”: “0”,
“masterBinlog”: “(mysql-bin.003468, 313408819)”,
“masterBinlogGtid”: “b5082f3c-43e9-11ef-b134-0c42a1475886:1-2195714025”,
“syncerBinlog”: “(mysql-bin.003458, 238386347)”,
“syncerBinlogGtid”: “b5082f3c-43e9-11ef-b134-0c42a1475886:1-2189273137”,
“blockingDDLs”: [
],
“unresolvedGroups”: [
{
“target”: “posx_prd.t_order”,
“DDLs”: [
“ALTER TABLE posx_prd.t_order MODIFY COLUMN mercode VARCHAR(80) CHARACTER SET UTF8MB4 COLLATE utf8mb4_0900_ai_ci DEFAULT ‘0’ NOT NULL COMMENT ‘渠道商户号’”
],
“firstLocation”: “position: (mysql-bin.003458, 238386347), gtid-set: b5082f3c-43e9-11ef-b134-0c42a1475886:1-2189273137”,
“synced”: [
“posx_prd.t_order_0”
],
“unsynced”: [
“posx_prd.t_order_15”,
“posx_prd.t_order_7”,
“posx_prd.t_order_9”,
“posx_prd.t_order_16”,
“posx_prd.t_order_17”,
“posx_prd.t_order_27”,
“posx_prd.t_order_45”,
“posx_prd.t_order_56”,
“posx_prd.t_order_13”,
“posx_prd.t_order_20”,
“posx_prd.t_order_31”,
“posx_prd.t_order_38”,
“posx_prd.t_order_4”,
“posx_prd.t_order_40”,
“posx_prd.t_order_14”,
“posx_prd.t_order_19”,
“posx_prd.t_order_24”,
“posx_prd.t_order_10”,
“posx_prd.t_order_26”,
“posx_prd.t_order_28”,
“posx_prd.t_order_44”,
“posx_prd.t_order_63”,
“posx_prd.t_order_23”,
“posx_prd.t_order_35”,
“posx_prd.t_order_50”,
“posx_prd.t_order_2”,
“posx_prd.t_order_32”,
“posx_prd.t_order_47”,
“posx_prd.t_order_8”,
“posx_prd.t_order_11”,
“posx_prd.t_order_36”,
“posx_prd.t_order_49”,
“posx_prd.t_order_1”,
“posx_prd.t_order_30”,
“posx_prd.t_order_39”,
“posx_prd.t_order_33”,
“posx_prd.t_order_43”,
“posx_prd.t_order_52”,
“posx_prd.t_order_59”,
“posx_prd.t_order_29”,
“posx_prd.t_order_34”,
“posx_prd.t_order_57”,
“posx_prd.t_order_6”,
“posx_prd.t_order_5”,
“posx_prd.t_order_21”,
“posx_prd.t_order_3”,
“posx_prd.t_order_41”,
“posx_prd.t_order_53”,
“posx_prd.t_order_54”,
“posx_prd.t_order_55”,
“posx_prd.t_order_58”,
“posx_prd.t_order_22”,
“posx_prd.t_order_25”,
“posx_prd.t_order_48”,
“posx_prd.t_order_61”,
“posx_prd.t_order_12”,
“posx_prd.t_order_18”,
“posx_prd.t_order_37”,
“posx_prd.t_order_42”,
“posx_prd.t_order_46”,
“posx_prd.t_order_51”,
“posx_prd.t_order_60”,
“posx_prd.t_order_62”
]
}
],
“synced”: false,
“binlogType”: “remote”,
“secondsBehindMaster”: “0”,
“blockDDLOwner”: “”,
“conflictMsg”: “”,
“totalRows”: “523252”,
“totalRps”: “401”,
“recentRps”: “0”
},
“validation”: null
}
]
}
]
}
使用 tiup dmctl --master-addr 192.168.138.210:8261 handle-error test1 skip 跳过 后 过一会又报错了,而且不同步,这个大佬如何跳过这个报错,让数据继续同步