github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/pkg/config/config_test_data.go (about)

     1  // Copyright 2021 PingCAP, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  package config
    15  
    16  const (
    17  	testCfgTestReplicaConfigOutDated = `{
    18    "memory-quota": 1073741824,
    19    "case-sensitive": false,
    20    "force-replicate": true,
    21    "ignore-ineligible-table":false,
    22    "check-gc-safe-point": true,
    23    "enable-sync-point": false,
    24    "enable-table-monitor": false,
    25    "bdr-mode": false,
    26    "sync-point-interval": 600000000000,
    27    "sync-point-retention": 86400000000000,
    28    "filter": {
    29      "rules": [
    30        "1.1"
    31      ],
    32      "ignore-txn-start-ts": null
    33    },
    34    "mounter": {
    35      "worker-num": 3
    36    },
    37    "sink": {
    38      "encoder-concurrency": 32,
    39      "terminator": "\r\n",
    40  	"date-separator": "day",
    41      "dispatch-rules": [
    42        {
    43          "db-name": "a",
    44          "tbl-name": "b",
    45          "rule": "r1"
    46        },
    47        {
    48          "db-name": "a",
    49          "tbl-name": "c",
    50          "rule": "r2"
    51        },
    52        {
    53          "db-name": "a",
    54          "tbl-name": "d",
    55          "rule": "r2"
    56        }
    57      ],
    58      "enable-partition-separator": true,
    59      "protocol": "canal-json",
    60  	"enable-kafka-sink-v2": false,
    61  	"only-output-updated-columns": false,
    62  	"delete-only-output-handle-key-columns": false,
    63      "content-compatible": false,
    64      "large-message-handle": {
    65        "large-message-handle-option": "none",
    66        "large-message-handle-compression": "",
    67        "claim-check-storage-uri": ""
    68      },
    69      "advance-timeout-in-sec": 150,
    70      "send-bootstrap-interval-in-sec": 120,
    71      "send-bootstrap-in-msg-count": 10000,
    72      "send-bootstrap-to-all-partition": true,
    73      "debezium-disable-schema": false,
    74      "open": {
    75        "output-old-value": true
    76      },
    77      "debezium": {
    78        "output-old-value": true
    79      }
    80    },
    81    "consistent": {
    82      "level": "none",
    83      "max-log-size": 64,
    84      "flush-interval": 2000,
    85      "meta-flush-interval": 200,
    86      "compression": "",
    87      "encoding-worker-num": 16,
    88      "flush-worker-num": 8,
    89      "storage": "",
    90      "use-file-backend": false,
    91      "memory-usage": {
    92          "memory-quota-percentage": 50
    93      }
    94    },
    95    "scheduler": {
    96      "enable-table-across-nodes": false,
    97      "region-threshold": 100000
    98    },
    99    "integrity": {
   100      "integrity-check-level": "none",
   101      "corruption-handle-level": "warn"
   102   },
   103    "changefeed-error-stuck-duration": 1800000000000,
   104    "synced-status": {
   105      "synced-check-interval": 300,
   106      "checkpoint-interval": 15
   107    }
   108  }`
   109  
   110  	testCfgTestServerConfigMarshal = `{
   111    "addr": "192.155.22.33:8887",
   112    "advertise-addr": "",
   113    "log-file": "",
   114    "log-level": "info",
   115    "log": {
   116      "file": {
   117        "max-size": 300,
   118        "max-days": 0,
   119        "max-backups": 0
   120      },
   121      "error-output": "stderr"
   122    },
   123    "data-dir": "",
   124    "gc-ttl": 86400,
   125    "tz": "System",
   126    "capture-session-ttl": 10,
   127    "owner-flush-interval": 50000000,
   128    "processor-flush-interval": 50000000,
   129    "sorter": {
   130      "sort-dir": "/tmp/sorter",
   131      "cache-size-in-mb": 128,
   132      "max-memory-percentage": 0,
   133      "max-memory-consumption": 0,
   134      "num-workerpool-goroutine": 0,
   135      "num-concurrent-worker": 0,
   136      "chunk-size-limit": 0
   137    },
   138    "security": {
   139      "ca-path": "",
   140      "cert-path": "",
   141      "key-path": "",
   142      "cert-allowed-cn": null,
   143      "mtls": false,
   144      "client-user-required": false,
   145      "client-allowed-user": null
   146    },
   147    "kv-client": {
   148      "enable-multiplexing": true,
   149      "worker-concurrent": 8,
   150      "grpc-stream-concurrent": 1,
   151      "advance-interval-in-ms": 300,
   152      "frontier-concurrent": 8,
   153      "worker-pool-size": 0,
   154      "region-scan-limit": 40,
   155      "region-retry-duration": 60000000000
   156    },
   157    "debug": {
   158      "db": {
   159        "count": 8,
   160        "max-open-files": 10000,
   161        "block-size": 65536,
   162        "writer-buffer-size": 8388608,
   163        "compression": "snappy",
   164        "write-l0-pause-trigger": 2147483647,
   165        "compaction-l0-trigger": 16
   166      },
   167      "messages": {
   168        "client-max-batch-interval": 10000000,
   169        "client-max-batch-size": 8388608,
   170        "client-max-batch-count": 128,
   171        "client-retry-rate-limit": 1,
   172        "server-max-pending-message-count": 102400,
   173        "server-ack-interval": 100000000,
   174        "server-worker-pool-size": 4,
   175        "max-recv-msg-size": 268435456,
   176        "keep-alive-time": 30000000000,
   177        "keep-alive-timeout": 10000000000
   178      },
   179      "scheduler": {
   180        "heartbeat-tick": 2,
   181        "collect-stats-tick": 200,
   182        "max-task-concurrency": 10,
   183        "check-balance-interval": 60000000000,
   184        "add-table-batch-size": 50
   185      },
   186      "cdc-v2": {
   187        "enable": false,
   188        "meta-store": {
   189          "uri": "",
   190          "ssl-ca": "",
   191          "ssl-cert": "",
   192          "ssl-key": ""
   193        }
   194      },
   195      "puller": {
   196        "enable-resolved-ts-stuck-detection": false,
   197        "resolved-ts-stuck-interval": 300000000000,
   198        "log-region-details": false
   199      }
   200    },
   201    "cluster-id": "default",
   202    "gc-tuner-memory-threshold": 0,
   203    "per-table-memory-quota": 0,
   204    "max-memory-percentage": 0
   205  }`
   206  
   207  	testCfgTestReplicaConfigMarshal1 = `{
   208    "memory-quota": 1073741824,
   209    "case-sensitive": false,
   210    "force-replicate": true,
   211    "ignore-ineligible-table":false,
   212    "check-gc-safe-point": true,
   213    "enable-sync-point": false,
   214    "enable-table-monitor": false,
   215    "bdr-mode": false,
   216    "sync-point-interval": 600000000000,
   217    "sync-point-retention": 86400000000000,
   218    "filter": {
   219      "rules": [
   220        "1.1"
   221      ],
   222      "ignore-txn-start-ts": null,
   223      "event-filters": null
   224    },
   225    "mounter": {
   226      "worker-num": 3
   227    },
   228    "sink": {
   229    	"encoder-concurrency": 32,
   230      "protocol": "canal-json",
   231      "column-selectors": [
   232        {
   233          "matcher": [
   234            "1.1"
   235          ],
   236          "columns": [
   237            "a",
   238            "b"
   239          ]
   240        }
   241      ],
   242      "csv": {
   243        "delimiter": ",",
   244        "quote": "\"",
   245        "null": "\\N",
   246        "include-commit-ts": true,
   247        "binary-encoding-method":"base64",
   248        "output-old-value": false,
   249        "output-handle-key": false
   250      },
   251      "date-separator": "month",
   252      "enable-partition-separator": true,
   253      "enable-kafka-sink-v2": true,
   254      "only-output-updated-columns": true,
   255  	"delete-only-output-handle-key-columns": true,
   256      "content-compatible": true,
   257      "safe-mode": true,
   258  	"terminator": "\r\n",
   259  	"transaction-atomicity": "",
   260      "kafka-config": {
   261        "partition-num": 1,
   262        "replication-factor": 1,
   263        "kafka-version": "version",
   264        "max-message-bytes": 1,
   265        "compression": "gzip",
   266        "kafka-client-id": "client-id",
   267        "auto-create-topic": true,
   268        "dial-timeout": "1m",
   269        "write-timeout": "1m",
   270        "read-timeout": "1m",
   271        "required-acks": 1,
   272        "sasl-user": "user",
   273        "sasl-password": "password",
   274        "sasl-mechanism": "mechanism",
   275        "sasl-gssapi-auth-type": "type",
   276        "sasl-gssapi-keytab-path": "path",
   277        "sasl-gssapi-kerberos-config-path": "path",
   278        "sasl-gssapi-service-name": "service",
   279        "sasl-gssapi-user": "user",
   280        "sasl-gssapi-password": "password",
   281        "sasl-gssapi-realm": "realm",
   282        "sasl-gssapi-disable-pafxfast": true,
   283        "enable-tls": true,
   284        "ca": "ca",
   285        "cert": "cert",
   286        "key": "key",
   287        "codec-config": {
   288          "enable-tidb-extension": true,
   289          "max-batch-size": 100000,
   290          "avro-enable-watermark": true,
   291          "avro-decimal-handling-mode": "string",
   292          "avro-bigint-unsigned-handling-mode": "string",
   293  		"encoding-format": "json"
   294        },
   295        "large-message-handle": {
   296          "large-message-handle-option": "handle-key-only",
   297          "large-message-handle-compression": "",
   298          "claim-check-storage-uri": ""
   299        },
   300        "glue-schema-registry-config": {
   301          "region":"region",
   302          "registry-name":"registry"
   303        }
   304      },
   305  	"pulsar-config": {
   306  		"pulsar-version": "v2.10.0",
   307  		"authentication-token": "token",
   308  		"tls-trust-certs-file-path": "TLSTrustCertsFilePath_path",
   309  		"connection-timeout": 18,
   310  		"operation-timeout": 8,
   311  		"batching-max-publish-delay": 5000
   312  	},
   313      "mysql-config": {
   314        "worker-count": 8,
   315        "max-txn-row": 100000,
   316        "max-multi-update-row-size": 100000,
   317        "max-multi-update-row": 100000,
   318        "tidb-txn-mode": "pessimistic",
   319        "ssl-ca": "ca",
   320        "ssl-cert": "cert",
   321        "ssl-key": "key",
   322        "time-zone": "UTC",
   323        "write-timeout": "1m",
   324        "read-timeout": "1m",
   325        "timeout": "1m",
   326        "enable-batch-dml": true,
   327        "enable-multi-statement": true,
   328        "enable-cache-prepared-statement": true
   329      },
   330      "cloud-storage-config": {
   331        "worker-count": 8,
   332        "flush-interval": "1m",
   333        "file-size": 1024,
   334        "output-column-id":false
   335      },
   336      "advance-timeout-in-sec": 150,
   337      "send-bootstrap-interval-in-sec": 120,
   338      "send-bootstrap-in-msg-count": 10000,
   339      "send-bootstrap-to-all-partition": true,
   340      "debezium-disable-schema": false,
   341      "open": {
   342        "output-old-value": true
   343      },
   344      "debezium": {
   345        "output-old-value": true
   346      }
   347    },
   348    "consistent": {
   349      "level": "none",
   350      "max-log-size": 64,
   351      "flush-interval": 2000,
   352      "meta-flush-interval": 200,
   353      "compression": "",
   354      "encoding-worker-num": 16,
   355      "flush-worker-num": 8,
   356      "storage": "",
   357      "use-file-backend": false,
   358      "memory-usage": {
   359          "memory-quota-percentage": 50
   360      }
   361    },
   362    "scheduler": {
   363      "enable-table-across-nodes": true,
   364      "region-per-span": 0,
   365      "region-threshold": 100001,
   366      "write-key-threshold": 100001,
   367      "region-per-span": 0
   368    },
   369    "integrity": {
   370      "integrity-check-level": "none",
   371      "corruption-handle-level": "warn"
   372    },
   373    "changefeed-error-stuck-duration": 1800000000000,
   374    "synced-status": {
   375      "synced-check-interval": 300,
   376      "checkpoint-interval": 15
   377    },
   378    "sql-mode":""
   379  }`
   380  
   381  	testCfgTestReplicaConfigMarshal2 = `{
   382    "memory-quota": 1073741824,
   383    "case-sensitive": false,
   384    "force-replicate": true,
   385    "ignore-ineligible-table":false,
   386    "check-gc-safe-point": true,
   387    "enable-sync-point": false,
   388    "enable-table-monitor": false,
   389    "bdr-mode": false,
   390    "sync-point-interval": 600000000000,
   391    "sync-point-retention": 86400000000000,
   392    "filter": {
   393      "rules": [
   394        "1.1"
   395      ],
   396      "ignore-txn-start-ts": null
   397    },
   398    "mounter": {
   399      "worker-num": 3
   400    },
   401    "sink": {
   402      "encoder-concurrency": 32,
   403      "dispatchers": null,
   404      "protocol": "canal-json",
   405      "column-selectors": [
   406        {
   407          "matcher": [
   408            "1.1"
   409          ],
   410          "columns": [
   411            "a",
   412            "b"
   413          ]
   414        }
   415      ],
   416      "csv": {
   417        "delimiter": ",",
   418        "quote": "\"",
   419        "null": "\\N",
   420        "include-commit-ts": true,
   421        "binary-encoding-method":"base64",
   422        "output-old-value": false,
   423        "output-handle-key": false
   424      },
   425      "terminator": "\r\n",
   426  	"transaction-atomicity": "",
   427      "date-separator": "month",
   428      "enable-partition-separator": true,
   429  	"enable-kafka-sink-v2": true,
   430      "only-output-updated-columns": true,
   431  	"delete-only-output-handle-key-columns": true,
   432      "content-compatible": true,
   433      "safe-mode": true,
   434      "kafka-config": {
   435        "partition-num": 1,
   436        "replication-factor": 1,
   437        "kafka-version": "version",
   438        "max-message-bytes": 1,
   439        "compression": "gzip",
   440        "kafka-client-id": "client-id",
   441        "auto-create-topic": true,
   442        "dial-timeout": "1m",
   443        "write-timeout": "1m",
   444        "read-timeout": "1m",
   445        "required-acks": 1,
   446        "sasl-user": "user",
   447        "sasl-password": "password",
   448        "sasl-mechanism": "mechanism",
   449        "sasl-gssapi-auth-type": "type",
   450        "sasl-gssapi-keytab-path": "path",
   451        "sasl-gssapi-kerberos-config-path": "path",
   452        "sasl-gssapi-service-name": "service",
   453        "sasl-gssapi-user": "user",
   454        "sasl-gssapi-password": "password",
   455        "sasl-gssapi-realm": "realm",
   456        "sasl-gssapi-disable-pafxfast": true,
   457        "enable-tls": true,
   458        "ca": "ca",
   459        "cert": "cert",
   460        "key": "key",
   461        "codec-config": {
   462          "enable-tidb-extension": true,
   463          "max-batch-size": 100000,
   464          "avro-enable-watermark": true,
   465          "avro-decimal-handling-mode": "string",
   466          "avro-bigint-unsigned-handling-mode": "string",
   467          "encoding-format": "json"
   468        },
   469        "large-message-handle": {
   470          "large-message-handle-option": "handle-key-only",
   471          "claim-check-storage-uri": "",
   472          "claim-check-compression": ""
   473        },
   474        "glue-schema-registry-config": {
   475          "region":"region",
   476          "registry-name":"registry"
   477        }
   478      },
   479  	"pulsar-config": {
   480  		"pulsar-version": "v2.10.0",
   481  		"authentication-token": "token",
   482  		"tls-trust-certs-file-path": "TLSTrustCertsFilePath_path",
   483  		"connection-timeout": 18,
   484  		"operation-timeout": 8,
   485  		"batching-max-publish-delay": 5000
   486  	},
   487      "mysql-config": {
   488        "worker-count": 8,
   489        "max-txn-row": 100000,
   490        "max-multi-update-row-size": 100000,
   491        "max-multi-update-row": 100000,
   492        "tidb-txn-mode": "pessimistic",
   493        "ssl-ca": "ca",
   494        "ssl-cert": "cert",
   495        "ssl-key": "key",
   496        "time-zone": "UTC",
   497        "write-timeout": "1m",
   498        "read-timeout": "1m",
   499        "timeout": "1m",
   500        "enable-batch-dml": true,
   501        "enable-multi-statement": true,
   502        "enable-cache-prepared-statement": true
   503      },
   504      "cloud-storage-config": {
   505        "worker-count": 8,
   506        "flush-interval": "1m",
   507        "file-size": 1024,
   508        "output-column-id":false
   509      },
   510      "advance-timeout-in-sec": 150,
   511      "send-bootstrap-interval-in-sec": 120,
   512      "send-bootstrap-in-msg-count": 10000,
   513      "send-bootstrap-to-all-partition": true,
   514      "debezium-disable-schema": false,
   515      "open": {
   516        "output-old-value": true
   517      },
   518      "debezium": {
   519        "output-old-value": true
   520      }
   521    },
   522    "consistent": {
   523      "level": "none",
   524      "max-log-size": 64,
   525      "flush-interval": 2000,
   526      "meta-flush-interval": 200,
   527      "compression": "",
   528      "encoding-worker-num": 16,
   529      "flush-worker-num": 8,
   530      "storage": "",
   531      "use-file-backend": false,
   532      "memory-usage": {
   533          "memory-quota-percentage": 50
   534      }
   535    },
   536    "scheduler": {
   537      "enable-table-across-nodes": true,
   538      "region-threshold": 100001,
   539      "write-key-threshold": 100001
   540    },
   541    "integrity": {
   542      "integrity-check-level": "none",
   543      "corruption-handle-level": "warn"
   544    },
   545    "changefeed-error-stuck-duration": 1800000000000,
   546    "synced-status": {
   547      "synced-check-interval": 300,
   548      "checkpoint-interval": 15
   549    },
   550    "sql-mode":""
   551  }`
   552  )