Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support passing raw toml config for tiflash (#3355) #3368

Merged
merged 2 commits into from Oct 14, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #3355 to release-1.1


What problem does this PR solve?

support passing raw toml config for tiflash

follow up #3327

What is changed and how does it work?

origin way to set config:

    tiflash:
      baseImage: pingcap/tiflash
      maxFailoverCount: 3
      replicas: 1
      storageClaims:
        - resources:
            requests:
              storage: 1Gi
--        # storageClassName: local-storage
      # requests:
      #   storage: "1Gi"
      config:
        config:
          logger:
            level: "warn"
            count: 9
        proxy:
          log-level: "warn"
          gc:
            batch-keys: 501

after this pr, support pass config like this:

    tiflash:
      baseImage: pingcap/tiflash
      maxFailoverCount: 3
      replicas: 1
      storageClaims:
        - resources:
            requests:
              storage: 1Gi
--        # storageClassName: local-storage
      # requests:
      #   storage: "1Gi"
      config:
        config: |
          [logger]
            level = "warn"
            count = 9
        proxy: |
          log-level = "warn"
          [gc]
            batch-keys = 501

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Deploy cluster using the flowing yaml(one use raw, one use origin way),
Check pos normal and config in configmaps as expect

tidb-cluster.yaml CLICK ME

apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
  name: basic
spec:
  version: v4.0.6
  timezone: UTC
  pvReclaimPolicy: Delete
  discovery: {}
  configUpdateStrategy: RollingUpdate
  pd:
    baseImage: pingcap/pd
    replicas: 1
    # if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used
    # storageClassName: local-storage
    requests:
      storage: "1Gi"
    config: |
      [schedule]
        max-merge-region-keys = 22222
        max-merge-region-size = 22
  tikv:
    baseImage: pingcap/tikv
    replicas: 1
    # if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used
    # storageClassName: local-storage
    requests:
      storage: "1Gi"
    config: |
      [storage]
        # In basic examples, we set this to avoid using too much storage.
        reserve-space = "2MB"
  tidb:
    baseImage: pingcap/tidb
    replicas: 1
    service:
      type: ClusterIP
    config:
      token-limit: 203
      max-server-connections: 51
  pump:
    baseImage: pingcap/tidb-binlog
    replicas: 1
    # storageClassName: local-storage
    requests:
      storage: 20Gi
    # schedulerName: default-scheduler
    # config:
    #   gc: 7
    #   storage:
    #     kv:
    #       compaction-total-size-multiplier: 8.0
    config: |
      gc = 6
      [storage]
        [storage.kv]
          compaction-total-size-multiplier = 8.0


  tiflash:
    baseImage: pingcap/tiflash
    maxFailoverCount: 3
    replicas: 1
    storageClaims:
      - resources:
          requests:
            storage: 1Gi
        # storageClassName: local-storage
    # requests:
    #   storage: "1Gi"
    config:
      config: |
        [logger]
          level = "warn"
          count = 9
      proxy: |
        log-level = "warn"
        [gc]
          batch-keys = 501

tidb-cluster-ym.yamlCLICK ME

apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
  name: basic-ym
spec:
  version: v4.0.6
  timezone: UTC
  pvReclaimPolicy: Delete
  discovery: {}
  configUpdateStrategy: RollingUpdate
  pd:
    baseImage: pingcap/pd
    replicas: 1
    # if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used
    # storageClassName: local-storage
    requests:
      storage: "1Gi"
    config:
      schedule:
        max-merge-region-keys: 22222
        max-merge-region-size: 22
  tikv:
    baseImage: pingcap/tikv
    replicas: 1
    # if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used
    # storageClassName: local-storage
    requests:
      storage: "1Gi"
    config:
      storage:
        # In basic examples, we set this to avoid using too much storage.
        reserve-space: "2MB"
  tidb:
    baseImage: pingcap/tidb
    replicas: 1
    service:
      type: ClusterIP
    config:
      token-limit: 203
      max-server-connections: 51
  pump:
    baseImage: pingcap/tidb-binlog
    replicas: 1
    # storageClassName: local-storage
    requests:
      storage: 20Gi
    # schedulerName: default-scheduler
    config:
      gc: 6

  tiflash:
    baseImage: pingcap/tiflash
    maxFailoverCount: 3
    replicas: 1
    storageClaims:
      - resources:
          requests:
            storage: 1Gi
        # storageClassName: local-storage
    # requests:
    #   storage: "1Gi"
    config:
      config:
        logger:
          level: "warn"
          count: 9
      proxy:
        log-level: "warn"
        gc:
          batch-keys: 501

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Does this PR introduce a user-facing change?:

support passing raw toml config for tiflash

@july2993
Copy link
Contributor

I will pick it myself after 3356 merged

follow up pingcap#3327

origin way to set config:
```yaml
    tiflash:
      baseImage: pingcap/tiflash
      maxFailoverCount: 3
      replicas: 1
      storageClaims:
        - resources:
            requests:
              storage: 1Gi
--        # storageClassName: local-storage
      # requests:
      #   storage: "1Gi"
      config:
        config:
          logger:
            level: "warn"
            count: 9
        proxy:
          log-level: "warn"
          gc:
            batch-keys: 501
```
after this pr, support pass config like this:
```yaml
    tiflash:
      baseImage: pingcap/tiflash
      maxFailoverCount: 3
      replicas: 1
      storageClaims:
        - resources:
            requests:
              storage: 1Gi
--        # storageClassName: local-storage
      # requests:
      #   storage: "1Gi"
      config:
        config: |
          [logger]
            level = "warn"
            count = 9
        proxy: |
          log-level = "warn"
          [gc]
            batch-keys = 501
```
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (release-1.1@f36ae8c). Click here to learn what that means.
The diff coverage is n/a.

@@              Coverage Diff               @@
##             release-1.1    #3368   +/-   ##
==============================================
  Coverage               ?   43.13%           
==============================================
  Files                  ?      151           
  Lines                  ?    14421           
  Branches               ?        0           
==============================================
  Hits                   ?     6220           
  Misses                 ?     7577           
  Partials               ?      624           
Flag Coverage Δ
#unittest 43.13% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@DanielZhangQD DanielZhangQD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DanielZhangQD DanielZhangQD merged commit 7731440 into pingcap:release-1.1 Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT1 status/PTAL PR needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants