apiVersion: api/v1
kind: Case
name: dm_sharding_pessimistic_online_ddl
features: [dm]
summary: 测试online ddl悲观模式合库合表
steps: |
    1. 使用dmctl operate create source.yaml添加source
    2. 使用dmctl task-start task.yaml with
      with online-ddl: true,
      is-sharding: true,
      shard-mode: "pessimistic"
    3. 持续往上游写DML, 同时online-schema change with Gh-ost for one of the upstreams.检查DM task状态
    4. doing online-schema change with Gh-ost for other upstreams, 检查DM task状态
    5.  持续往上游写DML, 同时doing online-schema change with PT for one upstream, 检查DM task状态.
    6. Doing online-schema change with PT for other upstream, 检查DM task状态
    7. Check up streams and down streams for the ghost tables, trash tables.
    8. 检查上下游数据一致性
expectedResult: |
    步骤1. 创建source成功
    步骤2. 创建悲观合库合表任务成功
    步骤3. 使用dmctl query-status task-name查看任务
    步骤4. 使用dmctl query-status task-name查看任务
    步骤5. 使用dmctl query-status task-name查看任务
    步骤6. 使用dmctl query-status task-name查看任务
    步骤7. 检查ghost table ，trash table状态
    步骤8. 上下游数据对比一致
priority: P1
supportedVersions: [">2.0.0"]
tags: [dm]
designer: xujianxu@pingcap.com
automation: AUTOMATED
active: true
framework:
    generic:
        command:
            [
                "/bin/sh",
                "-c",
                "/dm_test_infra --workload testcases/dm_sharding_pessimistic_online_ddl/workload.yaml --path testcases/dm_sharding_pessimistic_online_ddl/path.yaml",
            ]
        workingDir: "/"
        env: null
        image: hub-new.pingcap.net/dm/test-infra:dm_sharding_pessimistic_online_ddl
        imagePullPolicy: Always
parameters:
    - type: RESOURCE
      name: upstream1
      default: upstream1
    - type: RESOURCE
      name: upstream2
      default: upstream2
    - type: RESOURCE
      name: downstream
      default: downstream
    - type: RESOURCE
      name: dm
      default: dm
    - type: RESOURCE
      name: workload
      default: workload
    - type: RESOURCE
      name: syncdiff
      default: syncdiff
    - type: RESOURCE
      name: osc
      default: osc
