---
name: test
task-mode: all
is-sharding: false
shard-mode: "pessimistic"
meta-schema: "dm_meta"
enable-heartbeat: false

target-database:
  host: "127.0.0.1"
  port: 4000
  user: "root"
  password: ""

mysql-instances:
  - source-id: "mysql-replica-01"
    block-allow-list:  "instance"
    route-rules: ["sharding-route-rules-table", "sharding-route-rules-schema"]
    mydumper-config-name: "global"
    loader-config-name: "global"
    syncer-config-name: "global"
    # sync t_1's alter event by task config(overwrite)
    # ignore t_2's alter event by source config
    filter-rules: ["user-filter-1"]

  - source-id: "mysql-replica-02"
    block-allow-list:  "instance"
    route-rules: ["sharding-route-rules-table", "sharding-route-rules-schema"]
    mydumper-config-name: "global"
    loader-config-name: "global"
    syncer-config-name: "global"
    # ignore t_2's alter event by task config
    filter-rules: ["user-filter-2"]

block-allow-list:
  instance:
    do-dbs: ["dmctl"]
    do-tables:
    -  db-name: "dmctl"
       tbl-name: "~^t_[\\d]+"

routes:
  sharding-route-rules-table:
    schema-pattern: dmctl
    table-pattern: t_*
    target-schema: dmctl
    target-table: t_target

  sharding-route-rules-schema:
    schema-pattern: dmctl
    target-schema: dmctl

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

loaders:
  global:
    pool-size: 16
    dir: "./dumped_data"

syncers:
  global:
    worker-count: 16
    batch: 100
    checkpoint-flush-interval: 1
    compact: true
    multiple-rows: true

filters:
  user-filter-1:
    schema-pattern: "dmctl"
    table-pattern: "t_1"
    events: ["all"]
    action: Do
  user-filter-2:
    schema-pattern: "dmctl"
    table-pattern: "t_2"
    sql-pattern: ["alter table .* add column aaa int"]
    action: Ignore
