apiVersion: api/v1
kind: Case
name: br_pitr_paypay_one_tikv_failure
framework:
    generic:
        command:
            - /pitrOneTiKVFailure
        workingDir: /
        image: hub-new.pingcap.net/tools/br-pitr-one-kv-failure:latest
        imagePullPolicy: Always
        defaultTimeout: 18000
parameters:
    - type: RESOURCE
      name: dst_tidb
      default: dst-tidb
    - type: RESOURCE
      name: src_tidb
      default: src-tidb
    - type: RESOURCE
      name: br
      default: br
    - type: RESOURCE
      name: mc
      default: mc
    - type: RESOURCE
      name: workload
      default: workload
    - type: RESOURCE
      name: syncdiff
      default: syncdiff
    - type: STRING
      name: br_log_opts
      default: |
          {"storage":"s3://tmp/br-log-backup?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","timeout":"10m", "task-name": "task1"}
    - type: STRING
      name: br_opts
      default: |
          {"storage":"s3://tmp/br-log-backup?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","timeout":"30m"}
    - type: STRING
      name: br_log_restore_opts
      default: |
          {"storage":"s3://tmp/br-log-backup?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","timeout":"180m"}
    - type: STRING
      name: global_variable
      default: '[{"name": "tidb_multi_statement_mode", "value": "on"}]'
    - type: STRING
      name: mc_rm_opts
      default: |
          {"path":"qa-minio/tmp/br-log-backup","timeout":"180m"}

summary: start log backup -> do full backup -> run paypay workload -> inject chaos failure for 1 TiKV pod -> pitr restore and consitency check
steps: |
    1. Start log backup
    2. Do full backup
    3. Start workload, and keep it running in background
    4. inject chaos failure for 1 TiKV pod
    6. Do a PiTR restore, and check data consistency
expectedResult: |
    1. log backup checkpoint lag should be less than 20m after tikv failure.
    2. PiTR restore and log restore is successful, and data consistency check passed
category: RELIABILITY
priority: P1
supportedVersions:
    - '>=6.1'
automation: AUTOMATED
tags:
    - br
    - acceptance
    - pitr
designer: zhangfubin@pingcap.com
