Error When Starting DM Backup

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

Original topic: DM备份启动报错

| username: Johnpan

TiDB 5.4.0
When starting the DM backup, the following error is reported:
“msg”: “[code=20003:class=dm-master:scope=internal:level=medium], Message: decode task config failed, RawCause: yaml: unmarshal errors:
line 37: field import-mode not found in type config.rawLoaderConfig
line 38: field on-duplicate not found in type config.rawLoaderConfig, Workaround: Please check the configuration file has correct YAML format.”
The configuration file has the following additional configuration:
loaders:
global:
import-mode: “sql”
on-duplicate: “ignore”

The entire YAML configuration file is as follows:
name: “ailearn_statistic-kaifa”
task-mode: “all”
shard-mode: “pessimistic”
meta-schema: “dm_meta” # A schema will be created in the downstream database to store metadata
ignore-checking-items: [“auto_increment_ID”] # In this example, there is an auto-increment primary key upstream, so it needs to be ignored

target-database:
host: “10.60.0.9”
port: 4000
user: “dm_worker”
password: “FslwxcUfxXBLFd1NV8yr5EBupFdiZEl2BTkx0g==”

mysql-instances:

  • source-id: “mysql-ailearn-kaifa” # Data source ID, which is the source-id in source1.yaml
    route-rules: [“sale-route-rule”] # Table route rules applied to this data source
    block-allow-list: “log-bak-ignored” # Block & Allow list applied to this data source
    loader-config-name: “global” # Name of the loaders configuration

Shard merge configuration

routes:
sale-route-rule:
schema-pattern: “ailearn_statistic”
table-pattern: “okminicourse_learn_record_*”
target-schema: “ailearn_statistic”
target-table: “okminicourse_learn_record”

Block and allow list

block-allow-list:
log-bak-ignored:
do-tables:
- db-name: “ailearn_statistic”
tbl-name: “okminicourse_learn_record_*”

loaders:
global:
import-mode: “sql”
on-duplicate: “ignore”

| username: Johnpan | Original post link

The image you provided is not accessible. Please provide the text content you need translated.

| username: songxuecheng | Original post link

import-mode: You can remove “sql”. This is the default setting.

| username: xiaohetao | Original post link

Try removing this import-mode: “sql”. If there are no special requirements, the default configuration should suffice.

| username: buchuitoudegou | Original post link

You did not fill in the DM version information. If it is consistent with your TiDB version, it should be 5.4.

The loaders configuration option in version 5.4 does not support the import-mode option.

FYI: DM 任务完整配置文件介绍 | PingCAP 文档中心