DM5.3同步报错

【 TiDB 使用环境】生产\测试环境\ POC
【 TiDB 版本】
【遇到的问题】
【复现路径】做过哪些操作出现的问题
【问题现象及影响】
【附件】

  • 相关日志、配置文件、Grafana 监控(https://metricstool.pingcap.com/)
  • TiUP Cluster Display 信息
  • TiUP CLuster Edit config 信息
  • TiDB-Overview 监控
  • 对应模块的 Grafana 监控(如有 BR、TiDB-binlog、TiCDC 等)
  • 对应模块日志(包含问题前后 1 小时日志)

我task 任务里并没有配置同步表t2,但是dm同步表t2 报错日志如下:
{

"ErrCode": 36067,

"ErrClass": "sync-unit",

"ErrScope": "internal",

"ErrLevel": "high",

"Message": "startLocation: [position: (mysql_bin.000028, 191783898), gtid-set: ], endLocation: [position: (mysql_bin.000028, 191784085), gtid-set: ], origin SQL: [alter /* gh-ost / table fan_test_one._t2_gho ADD COLUMN rank INT UNSIGNED NOT NULL DEFAULT 0]: parse DDL: alter / gh-ost */ table fan_test_one._t2_gho ADD COLUMN rank INT UNSIGNED NOT NULL DEFAULT 0",

"RawCause": "line 1 column 65 near "rank INT UNSIGNED NOT NULL DEFAULT 0" ",

"Workaround": "Please confirm your DDL statement is correct and needed. For TiDB compatible DDL, see https://docs.pingcap.com/tidb/stable/mysql-compatibility#ddl. You can use handle-error command to skip or replace the DDL or add a binlog filter rule to ignore it if the DDL is not needed."

}

],

"detail": null

},

任务配置如下:

    # 任务名,多个同时运行的任务不能重名。
name: "test01"
# 全量+增量 (all) 迁移模式。
task-mode: "all"

case-sensitive: false
online-ddl: true   

# 下游 TiDB 配置信息。
target-database:
  host: ""
  port: 4036
  user: "root"
  password: ""

mydumpers:                           # dump 处理单元的运行配置参数
  global:                            # 配置名称
    threads: 4                       # dump 处理单元从上游数据库实例导出数据的线程数量,默认值为 4
    chunk-filesize: 64               # dump 处理单元生成的数据文件大小,默认值为 64,单位为 MB
    extra-args: "--consistency none" # dump 处理单元的其他参数,不需要在 extra-args 中配置 table-list,DM 会自动生成

loaders:                             # load 处理单元的运行配置参数
  global:                            # 配置名称
    pool-size: 16                    # load 处理单元并发执行 dump 处理单元的 SQL 文件的线程数量,默认值为 16,当有多个实例同时向 TiDB 迁移数据时可根据负载情况适当调小该值
    dir: "./dumped_data"             # dump 处理单元输出 SQL 文件的目录,同时也是 load 处理单元读取文件的目录。该配置项的默认值为 "./dumped_data"。同实例对应的不同任务必须配置不同的目录

syncers:                             # sync 处理单元的运行配置参数
  global:                            # 配置名称
    worker-count: 4                # 应用已传输到本地的 binlog 的并发线程数量,默认值为16。调整此参数不会影响上游拉取日志的并发,但会对下游产生显著压力。
    batch: 100                       # sync 迁移到下游数据库的一个事务批次SQL 语句数,默认值为 100,建议一般不超过 500。
    enable-ansi-quotes: true         # 若 `session` 中设置 `sql-mode: "ANSI_QUOTES"`,则需开启此项
    safe-mode: false


# 当前数据迁移任务需要的全部上游 MySQL 实例配置。
mysql-instances:
-
  # 上游实例或者复制组 ID,参考 `inventory.ini` 的 `source_id` 或者 `dm-master.toml` 的 `source-id 配置`。
  source-id: "mysql-01"
  # 需要迁移的库名或表名的黑白名单的配置项名称,用于引用全局的黑白名单配置,全局配置见下面的 `block-allow-list` 的配置。
  block-allow-list: "global"          # 如果 DM 版本早于 v2.0.0-beta.2 则使用 black-white-list。
  # dump 处理单元的配置项名称,用于引用全局的 dump 处理单元配置。
  mydumper-config-name: "global"
  loader-config-name: "global"            # loaders 配置的名称
  syncer-config-name: "global"            # syncers 配置的名称



# 黑白名单全局配置,各实例通过配置项名引用。
block-allow-list:                     # 如果 DM 版本早于 v2.0.0-beta.2 则使用 black-white-list。
  global:
    do-tables:                        # 需要迁移的上游表的白名单。
    - db-name: "fan_test_one"              # 需要迁移的表的库名。
      tbl-name: "t1"          # 需要迁移的表的名称。
    - db-name: "sysbench"              # 需要迁移的表的库名。
      tbl-name: "sbtest1"          # 需要迁移的表的名称。

若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

配置文件是不是后改的t1,之前是全库

不是后改的,配置一直没有变过

我也有相同問題 DM5.4

“Workaround”: “Please confirm your DDL statement is correct and needed. For TiDB compatible DDL, see https://docs.pingcap.com/tidb/stable/mysql-compatibility#ddl. You can use handle-error command to skip or replace the DDL or add a binlog filter rule to ignore it if the DDL is not needed.”

哪邊有handle-error command的教學 感謝

发一下配置呢? 是不是没有配置 DDL 的过滤?

handle-error --binlog-pos 可以跳过

FYI: https://docs.pingcap.com/zh/tidb/stable/handle-failed-ddl-statements#handle-error

1 个赞

设置了 balist,理论上应该也不会同步到这条语句吧:thinking:

你是使用的 rank 作为列名了,rank 是保留字,不能使用,mysql 同样报错,语法解析没有通过。和过滤没有关系。

tiup dmctl handle-error task-name skip ,这边配了全局dm-master,没指定addr

mysql变更是成功的。不然怎么写入binlog呢

该主题在最后一个回复创建后60天后自动关闭。不再允许新的回复。