---
name: test
task-mode: all
is-sharding: false
meta-schema: "dm_meta"
# enable-heartbeat: true
heartbeat-update-interval: 1
heartbeat-report-interval: 1

target-database:
  host: "127.0.0.1"
  port: 4000
  user: "root"
  password: ""
  session:
    tidb_skip_utf8_check: 1
    tidb_disable_txn_auto_retry: off
    tidb_retry_limit: "10"

mysql-instances:
  - source-id: "mysql-replica-01"
    black-white-list:  "instance" # compatible with deprecated config
    mydumper-config-name: "global"
    loader-config-name: "global"
    syncer-config-name: "global"
    filter-rules: ["user-filter-1"]
    route-rules: ["dup"]

  - source-id: "mysql-replica-02"
    block-allow-list:  "instance"
    mydumper-config-name: "global"
    loader-config-name: "global"
    syncer-config-name: "global"
    filter-rules: ["user-filter-1"]

black-white-list: # compatible with deprecated config
  instance:
    do-dbs: ["lightning_mode"]
    ignore-dbs: ["ignore_db"]

filters:                     # filter rules, mysql instance can ref rules in it
  user-filter-1:
    schema-pattern: "*"    # pattern of the upstream schema name, wildcard characters (*?) are supported
    table-pattern: "*"        # pattern of the upstream table name, wildcard characters (*?) are supported
    events: ["truncate table", "drop table"]  # ignore truncate/drop table ddl
    action: Ignore

routes:
  dup:
    schema-pattern: "lightning_mode"
    table-pattern: "dup*"
    target-schema: lightning_mode
    target-table: dup

mydumpers:
  global:
    threads: 4
    chunk-filesize: 64
    skip-tz-utc: true
    extra-args: ""

loaders:
  global:
    pool-size: 16
    dir: "./dumped_data"
    import-mode: "physical"
    on-duplicate-physical: "manual"

syncers:
  global:
    worker-count: 16
    batch: 100
    enable-ansi-quotes: false  # compatible with deprecated config
