为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:
【概述】 场景 + 问题概述
DM同步上游mysql的改字段名及默认值的ddl报错
【备份和数据迁移策略逻辑】
lightning全量,dm做增量
【现象】 业务和数据库现象
【问题】 当前遇到的问题
“errors”: [
{
“ErrCode”: 36062,
“ErrClass”: “sync-unit”,
“ErrScope”: “internal”,
“ErrLevel”: “high”,
“Message”: “startLocation: [position: (mysql-bin.000144, 670771848), gtid-set: ], endLocation: [position: (mysql-bin.000144, 670772125), gtid-set: ], origin SQL: [ALTER TABLE ts_coupon_group_multi
\r\
CHANGE COLUMN dis_tag
dis_tags
varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘折扣标签’ AFTER end_time
]: fail to handle shard ddl [ALTER TABLE db_ysbg_user
.ts_coupon_group_multi
CHANGE COLUMN dis_tag
dis_tags
VARCHAR(20) CHARACTER SET UTF8 COLLATE utf8_general_ci NOT NULL DEFAULT _UTF8MB4’’ COMMENT ‘折扣标签’ AFTER end_time
] in optimistic mode, because schema conflict detected, conflict error: [code=11111:class=functional:scope=internal:level=medium], Message: fail to try sync the optimistic shard ddl lock task6-db_ysbg_user
.ts_coupon_group_multi
: there will be conflicts if DDLs [ALTER TABLE db_ysbg_user
.ts_coupon_group_multi
CHANGE COLUMNdis_tag
dis_tags
VARCHAR(20) CHARACTER SET UTF8 COLLATE utf8_general_ci NOT NULL DEFAULT _UTF8MB4’’ COMMENT ‘折扣标签’ AFTER end_time
] are applied to the downstream. old table info: CREATE TABLE tbl
(begin_time
INT(11) NOT NULL DEFAULT 0, coupontype_gp_id
INT(11) NOT NULL, dis_tag
VARCHAR(20) CHARACTER SET UTF8 COLLATE utf8_bin NOT NULL DEFAULT , end_time
INT(11) NOT NULL DEFAULT 0, id
INT(11) NOT NULL AUTO_INCREMENT, lowest_dis
DECIMAL(4,3) NOT NULL DEFAULT 1.000, lowest_tag
VARCHAR(30) CHARACTER SET UTF8 COLLATE utf8_bin NOT NULL DEFAULT , PRIMARY KEY (id
)) CHARSET UTF8 COLLATE UTF8_BIN, new table info: CREATE TABLE tbl
(begin_time
INT(11) NOT NULL DEFAULT 0, coupontype_gp_id
INT(11) NOT NULL, dis_tags
VARCHAR(20) CHARACTER SET UTF8 COLLATE utf8_general_ci NOT NULL DEFAULT , end_time
INT(11) NOT NULL DEFAULT 0, id
INT(11) NOT NULL AUTO_INCREMENT, lowest_dis
DECIMAL(4,3) NOT NULL DEFAULT 1.000, lowest_tag
VARCHAR(30) CHARACTER SET UTF8 COLLATE utf8_bin NOT NULL DEFAULT , PRIMARY KEY (id
)) CHARSET UTF8 COLLATE UTF8_BIN, RawCause: at tuple index 2: at map key “dis_tags”: combining contradicting orders (1 \u0026\u0026 -1), Workaround: Please use show-ddl-locks
command for more details.”,
“RawCause”: “”,
“Workaround”: “Please use show-ddl-locks command for more details.”
}
]
{
"ErrCode": 36062,
"ErrClass": "sync-unit",
"ErrScope": "internal",
"ErrLevel": "high",
"Message": "startLocation: [position: (mysql-bin.000144, 669971834), gtid-set: ], endLocation: [position: (mysql-bin.000144, 669972108), gtid-set: ], origin SQL: [ALTER TABLE `ts_coupon_group_multi`\r\
MODIFY COLUMN `lowest_dis` decimal(4,3) NOT NULL DEFAULT 2 COMMENT '列表折后约xx价格对应的折扣 0.97表示九七折' AFTER `lowest_tag`]: fail to handle shard ddl [ALTER TABLE `db_ysbg_user`.`ts_coupon_group_multi` MODIFY COLUMN `lowest_dis` DECIMAL(4,3) NOT NULL DEFAULT 2 COMMENT '列表折后约xx价格对应的折扣 0.97表示九七折' AFTER `lowest_tag`] in optimistic mode, because schema conflict detected, conflict error: [code=11111:class=functional:scope=internal:level=medium], Message: fail to try sync the optimistic shard ddl lock task6-`db_ysbg_user`.`ts_coupon_group_multi`: there will be conflicts if DDLs [ALTER TABLE `db_ysbg_user`.`ts_coupon_group_multi` MODIFY COLUMN `lowest_dis` DECIMAL(4,3) NOT NULL DEFAULT 2 COMMENT '列表折后约xx价格对应的折扣 0.97表示九七折' AFTER `lowest_tag`] are applied to the downstream. old table info: CREATE TABLE `tbl`(`begin_time` INT(11) NOT NULL DEFAULT 0, `coupontype_gp_id` INT(11) NOT NULL, `dis_tag` VARCHAR(20) CHARACTER SET UTF8 COLLATE utf8_bin NOT NULL DEFAULT , `end_time` INT(11) NOT NULL DEFAULT 0, `id` INT(11) NOT NULL AUTO_INCREMENT, `lowest_dis` DECIMAL(4,3) NOT NULL DEFAULT 1.000, `lowest_tag` VARCHAR(30) CHARACTER SET UTF8 COLLATE utf8_bin NOT NULL DEFAULT , PRIMARY KEY (`id`)) CHARSET UTF8 COLLATE UTF8_BIN, new table info: CREATE TABLE `tbl`(`begin_time` INT(11) NOT NULL DEFAULT 0, `coupontype_gp_id` INT(11) NOT NULL, `dis_tag` VARCHAR(20) CHARACTER SET UTF8 COLLATE utf8_bin NOT NULL DEFAULT , `end_time` INT(11) NOT NULL DEFAULT 0, `id` INT(11) NOT NULL AUTO_INCREMENT, `lowest_dis` DECIMAL(4,3) NOT NULL DEFAULT 2, `lowest_tag` VARCHAR(30) CHARACTER SET UTF8 COLLATE utf8_bin NOT NULL DEFAULT , PRIMARY KEY (`id`)) CHARSET UTF8 COLLATE UTF8_BIN, RawCause: at tuple index 2: at map key \"lowest_dis\": at tuple index 0: distinct singletons (1.000 vs 2), Workaround: Please use `show-ddl-locks` command for more details.",
"RawCause": "",
"Workaround": "Please use show-ddl-locks command for more details."
}
【业务影响】
【TiDB 版本】
tidb:v5.0.2
dm: v2.0.3