apiVersion: api/v1
kind: Case
name: dm_sharding_pessimistic_add_index
features: [dm]
summary: 测试悲观模式合库合表
steps: |
    1. 使用dmctl operate create source.yaml添加source
    2. 使用dmctl task-start task.yaml with
      with is-sharding: true,
      shard-mode: "pessimistic"
    3. 分成两个进程load 1GB DML  ->  10s之后load DDL  for to upstream to task. 
    4. 依次向两个上游create index.
    5. check downstream status and analyse the speed.
expectedResult: |
    步骤1. 创建source成功
    步骤2. 创建悲观合库合表任务成功
    步骤3. 使用dmctl query-status task-name查看任务
    步骤4. 5min之后，上下游对比一致
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_add_index/workload.yaml --path testcases/dm_sharding_pessimistic_add_index/path.yaml",
            ]
        workingDir: "/"
        env: null
        image: hub-new.pingcap.net/dm/test-infra:dm_sharding_pessimistic_add_index
        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: STRING
      name: ddlStatement
      default: |
          'create index idx0 on test.usertable (FIELD0);'
