apiVersion: api/v1
kind: Case
name: dm_sharding_pessimistic_add_column
features: [dm]
summary: 测试悲观模式合库合表
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. 在增量数据导入的时候之前分别执行alter table add column, 之后继续导入数据
    4. 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_column/workload.yaml --path testcases/dm_sharding_pessimistic_add_column/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: |
          'alter table test.usertable add column FIELD10 varchar(100) DEFAULT 0;'
