diff --git a/manifests/crd.yaml b/manifests/crd.yaml index 49a83c1836..1ca65e8b71 100644 --- a/manifests/crd.yaml +++ b/manifests/crd.yaml @@ -4666,31 +4666,31 @@ spec: type: integer region-max-keys: description: 'When the number of keys in Region [a,e) exceeds - the `region_max_keys`, it will be split into several Regions + the `region-max-keys`, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), - [b,c), [c,d) will be `region_split_keys`. See also: region-split-keys + [b,c), [c,d) will be `region-split-keys`. See also: region-split-keys Optional: Defaults to 1440000 optional' format: int64 type: integer region-max-size: - description: 'When Region [a,e) size exceeds `region_max_size`, + description: 'When Region [a,e) size exceeds `region-max-size`, it will be split into several Regions [a,b), [b,c), [c,d), - [d,e) and the size of [a,b), [b,c), [c,d) will be `region_split_size` + [d,e) and the size of [a,b), [b,c), [c,d) will be `region-split-size` (or a little larger). See also: region-split-size Optional: Defaults to 144MB optional' type: string region-split-keys: description: 'When the number of keys in Region [a,e) exceeds - the `region_max_keys`, it will be split into several Regions + the `region-max-keys`, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), - [b,c), [c,d) will be `region_split_keys`. See also: region-max-keys + [b,c), [c,d) will be `region-split-keys`. See also: region-max-keys Optional: Defaults to 960000 optional' format: int64 type: integer region-split-size: - description: 'When Region [a,e) size exceeds `region_max_size`, + description: 'When Region [a,e) size exceeds `region-max-size`, it will be split into several Regions [a,b), [b,c), [c,d), - [d,e) and the size of [a,b), [b,c), [c,d) will be `region_split_size` + [d,e) and the size of [a,b), [b,c), [c,d) will be `region-split-size` (or a little larger). See also: region-max-size Optional: Defaults to 96MB optional' type: string @@ -4704,37 +4704,37 @@ spec: type: object gc: properties: - "\tbatch_keys": + "\tbatch-keys": description: 'Optional: Defaults to 512' format: int64 type: integer - "\tmax_write_bytes_per_sec": + "\tmax-write-bytes-per-sec": type: string type: object import: properties: - import_dir: + import-dir: type: string - max_open_engines: + max-open-engines: format: int64 type: integer - max_prepare_duration: + max-prepare-duration: type: string - num_import_jobs: + num-import-jobs: format: int64 type: integer - num_import_sst_jobs: + num-import-sst-jobs: format: int64 type: integer - num_threads: + num-threads: format: int64 type: integer - region_split_size: + region-split-size: type: string - stream_channel_window: + stream-channel-window: format: int64 type: integer - upload_speed_limit: + upload-speed-limit: type: string type: object log-file: @@ -4757,20 +4757,20 @@ spec: items: type: string type: array - retry_interval: + retry-interval: description: |- The interval at which to retry a PD connection initialization. Default is 300ms. Optional: Defaults to 300ms type: string - retry_log_every: + retry-log-every: description: |- If the client observes the same error message on retry, it can repeat the message only every `n` times. Default is 10. Set to 1 to disable this feature. Optional: Defaults to 10 format: int64 type: integer - retry_max_count: + retry-max-count: description: |- The maximum number of times to retry a PD connection initialization. @@ -4780,13 +4780,13 @@ spec: type: object raftdb: properties: - allow_concurrent_memtable_write: + allow-concurrent-memtable-write: type: boolean - bytes_per_sync: + bytes-per-sync: type: string - compaction_readahead_size: + compaction-readahead-size: type: string - create_if_missing: + create-if-missing: type: boolean defaultcf: description: TiKVCfConfig is the config of a cf @@ -4897,48 +4897,48 @@ spec: write-buffer-size: type: string type: object - enable_pipelined_write: + enable-pipelined-write: type: boolean - enable_statistics: + enable-statistics: type: boolean - info_log_dir: + info-log-dir: type: string - info_log_keep_log_file_num: + info-log-keep-log-file-num: format: int64 type: integer - info_log_max_size: + info-log-max-size: type: string - info_log_roll_time: + info-log-roll-time: type: string - max_background_jobs: + max-background-jobs: format: int64 type: integer - max_manifest_file_size: + max-manifest-file-size: type: string - max_open_files: + max-open-files: format: int64 type: integer - max_sub_compactions: + max-sub-compactions: format: int64 type: integer - max_total_wal_size: + max-total-wal-size: type: string - stats_dump_period: + stats-dump-period: type: string - use_direct_io_for_flush_and_compaction: + use-direct-io-for-flush-and-compaction: type: boolean - wal_bytes_per_sync: + wal-bytes-per-sync: type: string - wal_dir: + wal-dir: type: string - wal_recovery_mode: + wal-recovery-mode: type: string - wal_size_limit: + wal-size-limit: type: string - wal_ttl_seconds: + wal-ttl-seconds: format: int64 type: integer - writable_file_max_buffer_size: + writable-file-max-buffer-size: type: string type: object raftstore: @@ -5120,61 +5120,61 @@ spec: properties: coprocessor: properties: - high_concurrency: + high-concurrency: description: 'Optional: Defaults to 8' format: int64 type: integer - low_concurrency: + low-concurrency: description: 'Optional: Defaults to 8' format: int64 type: integer - max_tasks_per_worker_high: + max-tasks-per-worker-high: description: 'Optional: Defaults to 2000' format: int64 type: integer - max_tasks_per_worker_low: + max-tasks-per-worker-low: description: 'Optional: Defaults to 2000' format: int64 type: integer - max_tasks_per_worker_normal: + max-tasks-per-worker-normal: description: 'Optional: Defaults to 2000' format: int64 type: integer - normal_concurrency: + normal-concurrency: description: 'Optional: Defaults to 8' format: int64 type: integer - stack_size: + stack-size: description: 'Optional: Defaults to 10MB' type: string type: object storage: properties: - high_concurrency: + high-concurrency: description: 'Optional: Defaults to 4' format: int64 type: integer - low_concurrency: + low-concurrency: description: 'Optional: Defaults to 4' format: int64 type: integer - max_tasks_per_worker_high: + max-tasks-per-worker-high: description: 'Optional: Defaults to 2000' format: int64 type: integer - max_tasks_per_worker_low: + max-tasks-per-worker-low: description: 'Optional: Defaults to 2000' format: int64 type: integer - max_tasks_per_worker_normal: + max-tasks-per-worker-normal: description: 'Optional: Defaults to 2000' format: int64 type: integer - normal_concurrency: + normal-concurrency: description: 'Optional: Defaults to 4' format: int64 type: integer - stack_size: + stack-size: description: 'Optional: Defaults to 10MB' type: string type: object @@ -5707,11 +5707,11 @@ spec: type: string cert-path: type: string - cipher_file: + cipher-file: type: string key-path: type: string - override_ssl_target: + override-ssl-target: type: string type: object server: @@ -5760,6 +5760,9 @@ spec: grpc-keepalive-timeout: description: 'Optional: Defaults to 3s' type: string + grpc-memory-pool-quota: + description: 'Optional: Defaults to 32G' + type: string grpc-raft-conn-num: description: 'Optional: Defaults to 10' format: int32 @@ -5767,9 +5770,6 @@ spec: grpc-stream-initial-window-size: description: 'Optional: Defaults to 2MB' type: string - grpc_memory_pool_quota: - description: 'Optional: Defaults to 32G' - type: string heavy-load-threshold: format: int32 type: integer diff --git a/pkg/apis/pingcap/v1alpha1/openapi_generated.go b/pkg/apis/pingcap/v1alpha1/openapi_generated.go index c13249bf6c..c4223aa222 100644 --- a/pkg/apis/pingcap/v1alpha1/openapi_generated.go +++ b/pkg/apis/pingcap/v1alpha1/openapi_generated.go @@ -4141,28 +4141,28 @@ func schema_pkg_apis_pingcap_v1alpha1_TiKVCoprocessorConfig(ref common.Reference }, "region-max-size": { SchemaProps: spec.SchemaProps{ - Description: "When Region [a,e) size exceeds `region_max_size`, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region_split_size` (or a little larger). See also: region-split-size Optional: Defaults to 144MB optional", + Description: "When Region [a,e) size exceeds `region-max-size`, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region-split-size` (or a little larger). See also: region-split-size Optional: Defaults to 144MB optional", Type: []string{"string"}, Format: "", }, }, "region-split-size": { SchemaProps: spec.SchemaProps{ - Description: "When Region [a,e) size exceeds `region_max_size`, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region_split_size` (or a little larger). See also: region-max-size Optional: Defaults to 96MB optional", + Description: "When Region [a,e) size exceeds `region-max-size`, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region-split-size` (or a little larger). See also: region-max-size Optional: Defaults to 96MB optional", Type: []string{"string"}, Format: "", }, }, "region-max-keys": { SchemaProps: spec.SchemaProps{ - Description: "When the number of keys in Region [a,e) exceeds the `region_max_keys`, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be `region_split_keys`. See also: region-split-keys Optional: Defaults to 1440000 optional", + Description: "When the number of keys in Region [a,e) exceeds the `region-max-keys`, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be `region-split-keys`. See also: region-split-keys Optional: Defaults to 1440000 optional", Type: []string{"integer"}, Format: "int64", }, }, "region-split-keys": { SchemaProps: spec.SchemaProps{ - Description: "When the number of keys in Region [a,e) exceeds the `region_max_keys`, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be `region_split_keys`. See also: region-max-keys Optional: Defaults to 960000 optional", + Description: "When the number of keys in Region [a,e) exceeds the `region-max-keys`, it will be split into several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be `region-split-keys`. See also: region-max-keys Optional: Defaults to 960000 optional", Type: []string{"integer"}, Format: "int64", }, @@ -4179,49 +4179,49 @@ func schema_pkg_apis_pingcap_v1alpha1_TiKVCoprocessorReadPoolConfig(ref common.R SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "high_concurrency": { + "high-concurrency": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 8", Type: []string{"integer"}, Format: "int64", }, }, - "normal_concurrency": { + "normal-concurrency": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 8", Type: []string{"integer"}, Format: "int64", }, }, - "low_concurrency": { + "low-concurrency": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 8", Type: []string{"integer"}, Format: "int64", }, }, - "max_tasks_per_worker_high": { + "max-tasks-per-worker-high": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 2000", Type: []string{"integer"}, Format: "int64", }, }, - "max_tasks_per_worker_normal": { + "max-tasks-per-worker-normal": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 2000", Type: []string{"integer"}, Format: "int64", }, }, - "max_tasks_per_worker_low": { + "max-tasks-per-worker-low": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 2000", Type: []string{"integer"}, Format: "int64", }, }, - "stack_size": { + "stack-size": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 10MB", Type: []string{"string"}, @@ -4434,14 +4434,14 @@ func schema_pkg_apis_pingcap_v1alpha1_TiKVGCConfig(ref common.ReferenceCallback) SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - " batch_keys": { + " batch-keys": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 512", Type: []string{"integer"}, Format: "int64", }, }, - " max_write_bytes_per_sec": { + " max-write-bytes-per-sec": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", @@ -4459,55 +4459,55 @@ func schema_pkg_apis_pingcap_v1alpha1_TiKVImportConfig(ref common.ReferenceCallb SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "import_dir": { + "import-dir": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "num_threads": { + "num-threads": { SchemaProps: spec.SchemaProps{ Type: []string{"integer"}, Format: "int64", }, }, - "num_import_jobs": { + "num-import-jobs": { SchemaProps: spec.SchemaProps{ Type: []string{"integer"}, Format: "int64", }, }, - "num_import_sst_jobs": { + "num-import-sst-jobs": { SchemaProps: spec.SchemaProps{ Type: []string{"integer"}, Format: "int64", }, }, - "max_prepare_duration": { + "max-prepare-duration": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "region_split_size": { + "region-split-size": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "stream_channel_window": { + "stream-channel-window": { SchemaProps: spec.SchemaProps{ Type: []string{"integer"}, Format: "int64", }, }, - "max_open_engines": { + "max-open-engines": { SchemaProps: spec.SchemaProps{ Type: []string{"integer"}, Format: "int64", }, }, - "upload_speed_limit": { + "upload-speed-limit": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", @@ -4539,21 +4539,21 @@ func schema_pkg_apis_pingcap_v1alpha1_TiKVPDConfig(ref common.ReferenceCallback) }, }, }, - "retry_interval": { + "retry-interval": { SchemaProps: spec.SchemaProps{ Description: "The interval at which to retry a PD connection initialization.\n\nDefault is 300ms. Optional: Defaults to 300ms", Type: []string{"string"}, Format: "", }, }, - "retry_max_count": { + "retry-max-count": { SchemaProps: spec.SchemaProps{ Description: "The maximum number of times to retry a PD connection initialization.\n\nDefault is isize::MAX, represented by -1. Optional: Defaults to -1", Type: []string{"integer"}, Format: "int64", }, }, - "retry_log_every": { + "retry-log-every": { SchemaProps: spec.SchemaProps{ Description: "If the client observes the same error message on retry, it can repeat the message only every `n` times.\n\nDefault is 10. Set to 1 to disable this feature. Optional: Defaults to 10", Type: []string{"integer"}, @@ -4572,139 +4572,139 @@ func schema_pkg_apis_pingcap_v1alpha1_TiKVRaftDBConfig(ref common.ReferenceCallb SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "wal_recovery_mode": { + "wal-recovery-mode": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "wal_dir": { + "wal-dir": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "wal_ttl_seconds": { + "wal-ttl-seconds": { SchemaProps: spec.SchemaProps{ Type: []string{"integer"}, Format: "int64", }, }, - "wal_size_limit": { + "wal-size-limit": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "max_total_wal_size": { + "max-total-wal-size": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "max_background_jobs": { + "max-background-jobs": { SchemaProps: spec.SchemaProps{ Type: []string{"integer"}, Format: "int64", }, }, - "max_manifest_file_size": { + "max-manifest-file-size": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "create_if_missing": { + "create-if-missing": { SchemaProps: spec.SchemaProps{ Type: []string{"boolean"}, Format: "", }, }, - "max_open_files": { + "max-open-files": { SchemaProps: spec.SchemaProps{ Type: []string{"integer"}, Format: "int64", }, }, - "enable_statistics": { + "enable-statistics": { SchemaProps: spec.SchemaProps{ Type: []string{"boolean"}, Format: "", }, }, - "stats_dump_period": { + "stats-dump-period": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "compaction_readahead_size": { + "compaction-readahead-size": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "info_log_max_size": { + "info-log-max-size": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "info_log_roll_time": { + "info-log-roll-time": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "info_log_keep_log_file_num": { + "info-log-keep-log-file-num": { SchemaProps: spec.SchemaProps{ Type: []string{"integer"}, Format: "int64", }, }, - "info_log_dir": { + "info-log-dir": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "max_sub_compactions": { + "max-sub-compactions": { SchemaProps: spec.SchemaProps{ Type: []string{"integer"}, Format: "int64", }, }, - "writable_file_max_buffer_size": { + "writable-file-max-buffer-size": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "use_direct_io_for_flush_and_compaction": { + "use-direct-io-for-flush-and-compaction": { SchemaProps: spec.SchemaProps{ Type: []string{"boolean"}, Format: "", }, }, - "enable_pipelined_write": { + "enable-pipelined-write": { SchemaProps: spec.SchemaProps{ Type: []string{"boolean"}, Format: "", }, }, - "allow_concurrent_memtable_write": { + "allow-concurrent-memtable-write": { SchemaProps: spec.SchemaProps{ Type: []string{"boolean"}, Format: "", }, }, - "bytes_per_sync": { + "bytes-per-sync": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "wal_bytes_per_sync": { + "wal-bytes-per-sync": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", @@ -5098,13 +5098,13 @@ func schema_pkg_apis_pingcap_v1alpha1_TiKVSecurityConfig(ref common.ReferenceCal Format: "", }, }, - "override_ssl_target": { + "override-ssl-target": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", }, }, - "cipher_file": { + "cipher-file": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", @@ -5151,7 +5151,7 @@ func schema_pkg_apis_pingcap_v1alpha1_TiKVServerConfig(ref common.ReferenceCallb Format: "int32", }, }, - "grpc_memory_pool_quota": { + "grpc-memory-pool-quota": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 32G", Type: []string{"string"}, @@ -5530,49 +5530,49 @@ func schema_pkg_apis_pingcap_v1alpha1_TiKVStorageReadPoolConfig(ref common.Refer SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "high_concurrency": { + "high-concurrency": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 4", Type: []string{"integer"}, Format: "int64", }, }, - "normal_concurrency": { + "normal-concurrency": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 4", Type: []string{"integer"}, Format: "int64", }, }, - "low_concurrency": { + "low-concurrency": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 4", Type: []string{"integer"}, Format: "int64", }, }, - "max_tasks_per_worker_high": { + "max-tasks-per-worker-high": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 2000", Type: []string{"integer"}, Format: "int64", }, }, - "max_tasks_per_worker_normal": { + "max-tasks-per-worker-normal": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 2000", Type: []string{"integer"}, Format: "int64", }, }, - "max_tasks_per_worker_low": { + "max-tasks-per-worker-low": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 2000", Type: []string{"integer"}, Format: "int64", }, }, - "stack_size": { + "stack-size": { SchemaProps: spec.SchemaProps{ Description: "Optional: Defaults to 10MB", Type: []string{"string"}, diff --git a/pkg/apis/pingcap/v1alpha1/tikv_config.go b/pkg/apis/pingcap/v1alpha1/tikv_config.go index 9ad4155f85..fab4bea41a 100644 --- a/pkg/apis/pingcap/v1alpha1/tikv_config.go +++ b/pkg/apis/pingcap/v1alpha1/tikv_config.go @@ -65,50 +65,50 @@ type TiKVReadPoolConfig struct { type TiKVStorageReadPoolConfig struct { // Optional: Defaults to 4 // +optional - HighConcurrency *int64 `json:"high_concurrency,omitempty" toml:"high_concurrency,omitempty"` + HighConcurrency *int64 `json:"high-concurrency,omitempty" toml:"high-concurrency,omitempty"` // Optional: Defaults to 4 // +optional - NormalConcurrency *int64 `json:"normal_concurrency,omitempty" toml:"normal_concurrency,omitempty"` + NormalConcurrency *int64 `json:"normal-concurrency,omitempty" toml:"normal-concurrency,omitempty"` // Optional: Defaults to 4 // +optional - LowConcurrency *int64 `json:"low_concurrency,omitempty" toml:"low_concurrency,omitempty"` + LowConcurrency *int64 `json:"low-concurrency,omitempty" toml:"low-concurrency,omitempty"` // Optional: Defaults to 2000 // +optional - MaxTasksPerWorkerHigh *int64 `json:"max_tasks_per_worker_high,omitempty" toml:"max_tasks_per_worker_high,omitempty"` + MaxTasksPerWorkerHigh *int64 `json:"max-tasks-per-worker-high,omitempty" toml:"max-tasks-per-worker-high,omitempty"` // Optional: Defaults to 2000 // +optional - MaxTasksPerWorkerNormal *int64 `json:"max_tasks_per_worker_normal,omitempty" toml:"max_tasks_per_worker_normal,omitempty"` + MaxTasksPerWorkerNormal *int64 `json:"max-tasks-per-worker-normal,omitempty" toml:"max-tasks-per-worker-normal,omitempty"` // Optional: Defaults to 2000 // +optional - MaxTasksPerWorkerLow *int64 `json:"max_tasks_per_worker_low,omitempty" toml:"max_tasks_per_worker_low,omitempty"` + MaxTasksPerWorkerLow *int64 `json:"max-tasks-per-worker-low,omitempty" toml:"max-tasks-per-worker-low,omitempty"` // Optional: Defaults to 10MB // +optional - StackSize string `json:"stack_size,omitempty" toml:"stack_size,omitempty"` + StackSize string `json:"stack-size,omitempty" toml:"stack-size,omitempty"` } // +k8s:openapi-gen=true type TiKVCoprocessorReadPoolConfig struct { // Optional: Defaults to 8 // +optional - HighConcurrency *int64 `json:"high_concurrency,omitempty" toml:"high_concurrency,omitempty"` + HighConcurrency *int64 `json:"high-concurrency,omitempty" toml:"high-concurrency,omitempty"` // Optional: Defaults to 8 // +optional - NormalConcurrency *int64 `json:"normal_concurrency,omitempty" toml:"normal_concurrency,omitempty"` + NormalConcurrency *int64 `json:"normal-concurrency,omitempty" toml:"normal-concurrency,omitempty"` // Optional: Defaults to 8 // +optional - LowConcurrency *int64 `json:"low_concurrency,omitempty" toml:"low_concurrency,omitempty"` + LowConcurrency *int64 `json:"low-concurrency,omitempty" toml:"low-concurrency,omitempty"` // Optional: Defaults to 2000 // +optional - MaxTasksPerWorkerHigh *int64 `json:"max_tasks_per_worker_high,omitempty" toml:"max_tasks_per_worker_high,omitempty"` + MaxTasksPerWorkerHigh *int64 `json:"max-tasks-per-worker-high,omitempty" toml:"max-tasks-per-worker-high,omitempty"` // Optional: Defaults to 2000 // +optional - MaxTasksPerWorkerNormal *int64 `json:"max_tasks_per_worker_normal,omitempty" toml:"max_tasks_per_worker_normal,omitempty"` + MaxTasksPerWorkerNormal *int64 `json:"max-tasks-per-worker-normal,omitempty" toml:"max-tasks-per-worker-normal,omitempty"` // Optional: Defaults to 2000 // +optional - MaxTasksPerWorkerLow *int64 `json:"max_tasks_per_worker_low,omitempty" toml:"max_tasks_per_worker_low,omitempty"` + MaxTasksPerWorkerLow *int64 `json:"max-tasks-per-worker-low,omitempty" toml:"max-tasks-per-worker-low,omitempty"` // Optional: Defaults to 10MB // +optional - StackSize string `json:"stack_size,omitempty" toml:"stack_size,omitempty"` + StackSize string `json:"stack-size,omitempty" toml:"stack-size,omitempty"` } // +k8s:openapi-gen=true @@ -123,70 +123,70 @@ type TiKVPDConfig struct { // Default is 300ms. // Optional: Defaults to 300ms // +optional - RetryInterval string `json:"retry_interval,omitempty" toml:"retry_interval,omitempty"` + RetryInterval string `json:"retry-interval,omitempty" toml:"retry-interval,omitempty"` // The maximum number of times to retry a PD connection initialization. // // Default is isize::MAX, represented by -1. // Optional: Defaults to -1 // +optional - RetryMaxCount *int64 `json:"retry_max_count,omitempty" toml:"retry_max_count,omitempty"` + RetryMaxCount *int64 `json:"retry-max-count,omitempty" toml:"retry-max-count,omitempty"` // If the client observes the same error message on retry, it can repeat the message only // every `n` times. // // Default is 10. Set to 1 to disable this feature. // Optional: Defaults to 10 // +optional - RetryLogEvery *int64 `json:"retry_log_every,omitempty" toml:"retry_log_every,omitempty"` + RetryLogEvery *int64 `json:"retry-log-every,omitempty" toml:"retry-log-every,omitempty"` } // +k8s:openapi-gen=true type TiKVRaftDBConfig struct { // +optional - WalRecoveryMode string `json:"wal_recovery_mode,omitempty" toml:"wal_recovery_mode,omitempty"` + WalRecoveryMode string `json:"wal-recovery-mode,omitempty" toml:"wal-recovery-mode,omitempty"` // +optional - WalDir string `json:"wal_dir,omitempty" toml:"wal_dir,omitempty"` + WalDir string `json:"wal-dir,omitempty" toml:"wal-dir,omitempty"` // +optional - WalTtlSeconds *int64 `json:"wal_ttl_seconds,omitempty" toml:"wal_ttl_seconds,omitempty"` + WalTtlSeconds *int64 `json:"wal-ttl-seconds,omitempty" toml:"wal-ttl-seconds,omitempty"` // +optional - WalSizeLimit string `json:"wal_size_limit,omitempty" toml:"wal_size_limit,omitempty"` + WalSizeLimit string `json:"wal-size-limit,omitempty" toml:"wal-size-limit,omitempty"` // +optional - MaxTotalWalSize string `json:"max_total_wal_size,omitempty" toml:"max_total_wal_size,omitempty"` + MaxTotalWalSize string `json:"max-total-wal-size,omitempty" toml:"max-total-wal-size,omitempty"` // +optional - MaxBackgroundJobs *int64 `json:"max_background_jobs,omitempty" toml:"max_background_jobs,omitempty"` + MaxBackgroundJobs *int64 `json:"max-background-jobs,omitempty" toml:"max-background-jobs,omitempty"` // +optional - MaxManifestFileSize string `json:"max_manifest_file_size,omitempty" toml:"max_manifest_file_size,omitempty"` + MaxManifestFileSize string `json:"max-manifest-file-size,omitempty" toml:"max-manifest-file-size,omitempty"` // +optional - CreateIfMissing *bool `json:"create_if_missing,omitempty" toml:"create_if_missing,omitempty"` + CreateIfMissing *bool `json:"create-if-missing,omitempty" toml:"create-if-missing,omitempty"` // +optional - MaxOpenFiles *int64 `json:"max_open_files,omitempty" toml:"max_open_files,omitempty"` + MaxOpenFiles *int64 `json:"max-open-files,omitempty" toml:"max-open-files,omitempty"` // +optional - EnableStatistics *bool `json:"enable_statistics,omitempty" toml:"enable_statistics,omitempty"` + EnableStatistics *bool `json:"enable-statistics,omitempty" toml:"enable-statistics,omitempty"` // +optional - StatsDumpPeriod string `json:"stats_dump_period,omitempty" toml:"stats_dump_period,omitempty"` + StatsDumpPeriod string `json:"stats-dump-period,omitempty" toml:"stats-dump-period,omitempty"` // +optional - CompactionReadaheadSize string `json:"compaction_readahead_size,omitempty" toml:"compaction_readahead_size,omitempty"` + CompactionReadaheadSize string `json:"compaction-readahead-size,omitempty" toml:"compaction-readahead-size,omitempty"` // +optional - InfoLogMaxSize string `json:"info_log_max_size,omitempty" toml:"info_log_max_size,omitempty"` + InfoLogMaxSize string `json:"info-log-max-size,omitempty" toml:"info-log-max-size,omitempty"` // +optional - FnfoLogRollTime string `json:"info_log_roll_time,omitempty" toml:"info_log_roll_time,omitempty"` + FnfoLogRollTime string `json:"info-log-roll-time,omitempty" toml:"info-log-roll-time,omitempty"` // +optional - InfoLogKeepLogFileNum *int64 `json:"info_log_keep_log_file_num,omitempty" toml:"info_log_keep_log_file_num,omitempty"` + InfoLogKeepLogFileNum *int64 `json:"info-log-keep-log-file-num,omitempty" toml:"info-log-keep-log-file-num,omitempty"` // +optional - InfoLogDir string `json:"info_log_dir,omitempty" toml:"info_log_dir,omitempty"` + InfoLogDir string `json:"info-log-dir,omitempty" toml:"info-log-dir,omitempty"` // +optional - MaxSubCompactions *int64 `json:"max_sub_compactions,omitempty" toml:"max_sub_compactions,omitempty"` + MaxSubCompactions *int64 `json:"max-sub-compactions,omitempty" toml:"max-sub-compactions,omitempty"` // +optional - WritableFileMaxBufferSize string `json:"writable_file_max_buffer_size,omitempty" toml:"writable_file_max_buffer_size,omitempty"` + WritableFileMaxBufferSize string `json:"writable-file-max-buffer-size,omitempty" toml:"writable-file-max-buffer-size,omitempty"` // +optional - UseDirectIoForFlushAndCompaction *bool `json:"use_direct_io_for_flush_and_compaction,omitempty" toml:"use_direct_io_for_flush_and_compaction,omitempty"` + UseDirectIoForFlushAndCompaction *bool `json:"use-direct-io-for-flush-and-compaction,omitempty" toml:"use-direct-io-for-flush-and-compaction,omitempty"` // +optional - EnablePipelinedWrite *bool `json:"enable_pipelined_write,omitempty" toml:"enable_pipelined_write,omitempty"` + EnablePipelinedWrite *bool `json:"enable-pipelined-write,omitempty" toml:"enable-pipelined-write,omitempty"` // +optional - AllowConcurrentMemtableWrite *bool `json:"allow_concurrent_memtable_write,omitempty" toml:"allow_concurrent_memtable_write,omitempty"` + AllowConcurrentMemtableWrite *bool `json:"allow-concurrent-memtable-write,omitempty" toml:"allow-concurrent-memtable-write,omitempty"` // +optional - BytesPerSync string `json:"bytes_per_sync,omitempty" toml:"bytes_per_sync,omitempty"` + BytesPerSync string `json:"bytes-per-sync,omitempty" toml:"bytes-per-sync,omitempty"` // +optional - WalBytesPerSync string `json:"wal_bytes_per_sync,omitempty" toml:"wal_bytes_per_sync,omitempty"` + WalBytesPerSync string `json:"wal-bytes-per-sync,omitempty" toml:"wal-bytes-per-sync,omitempty"` // +optional Defaultcf *TiKVCfConfig `json:"defaultcf,omitempty" toml:"defaultcf,omitempty"` } @@ -200,40 +200,40 @@ type TiKVSecurityConfig struct { // +optional KeyPath string `json:"key-path,omitempty" toml:"key-path,omitempty"` // +optional - OverrideSslTarget string `json:"override_ssl_target,omitempty" toml:"override_ssl_target,omitempty"` + OverrideSslTarget string `json:"override-ssl-target,omitempty" toml:"override-ssl-target,omitempty"` // +optional - CipherFile string `json:"cipher_file,omitempty" toml:"cipher_file,omitempty"` + CipherFile string `json:"cipher-file,omitempty" toml:"cipher-file,omitempty"` } // +k8s:openapi-gen=true type TiKVImportConfig struct { // +optional - ImportDir string `json:"import_dir,omitempty" toml:"import_dir,omitempty"` + ImportDir string `json:"import-dir,omitempty" toml:"import-dir,omitempty"` // +optional - NumThreads *int64 `json:"num_threads,omitempty" toml:"num_threads,omitempty"` + NumThreads *int64 `json:"num-threads,omitempty" toml:"num-threads,omitempty"` // +optional - NumImportJobs *int64 `json:"num_import_jobs,omitempty" toml:"num_import_jobs,omitempty"` + NumImportJobs *int64 `json:"num-import-jobs,omitempty" toml:"num-import-jobs,omitempty"` // +optional - NumImportSstJobs *int64 `json:"num_import_sst_jobs,omitempty" toml:"num_import_sst_jobs,omitempty"` + NumImportSstJobs *int64 `json:"num-import-sst-jobs,omitempty" toml:"num-import-sst-jobs,omitempty"` // +optional - MaxPrepareDuration string `json:"max_prepare_duration,omitempty" toml:"max_prepare_duration,omitempty"` + MaxPrepareDuration string `json:"max-prepare-duration,omitempty" toml:"max-prepare-duration,omitempty"` // +optional - RegionSplitSize string `json:"region_split_size,omitempty" toml:"region_split_size,omitempty"` + RegionSplitSize string `json:"region-split-size,omitempty" toml:"region-split-size,omitempty"` // +optional - StreamChannelWindow *int64 `json:"stream_channel_window,omitempty" toml:"stream_channel_window,omitempty"` + StreamChannelWindow *int64 `json:"stream-channel-window,omitempty" toml:"stream-channel-window,omitempty"` // +optional - MaxOpenEngines *int64 `json:"max_open_engines,omitempty" toml:"max_open_engines,omitempty"` + MaxOpenEngines *int64 `json:"max-open-engines,omitempty" toml:"max-open-engines,omitempty"` // +optional - UploadSpeedLimit string `json:"upload_speed_limit,omitempty" toml:"upload_speed_limit,omitempty"` + UploadSpeedLimit string `json:"upload-speed-limit,omitempty" toml:"upload-speed-limit,omitempty"` } // +k8s:openapi-gen=true type TiKVGCConfig struct { // +optional // Optional: Defaults to 512 - BatchKeys *int64 `json:" batch_keys,omitempty" toml:" batch_keys,omitempty"` + BatchKeys *int64 `json:" batch-keys,omitempty" toml:" batch-keys,omitempty"` // +optional - MaxWriteBytesPerSec string `json:" max_write_bytes_per_sec,omitempty" toml:" max_write_bytes_per_sec,omitempty"` + MaxWriteBytesPerSec string `json:" max-write-bytes-per-sec,omitempty" toml:" max-write-bytes-per-sec,omitempty"` } // TiKVDbConfig is the rocksdb config. @@ -476,7 +476,7 @@ type TiKVServerConfig struct { GrpcConcurrentStream *uint `json:"grpc-concurrent-stream,omitempty" toml:"grpc-concurrent-stream,omitempty"` // Optional: Defaults to 32G // +optional - GrpcMemoryQuota *string `json:"grpc_memory_pool_quota,omitempty" toml:"grpc_memory_pool_quota,omitempty"` + GrpcMemoryQuota *string `json:"grpc-memory-pool-quota,omitempty" toml:"grpc-memory-pool-quota,omitempty"` // Optional: Defaults to 10 // +optional GrpcRaftConnNum *uint `json:"grpc-raft-conn-num,omitempty" toml:"grpc-raft-conn-num,omitempty"` @@ -710,30 +710,30 @@ type TiKVCoprocessorConfig struct { // optional BatchSplitLimit *int64 `json:"batch-split-limit,omitempty" toml:"batch-split-limit,omitempty"` - // When Region [a,e) size exceeds `region_max_size`, it will be split into several Regions [a,b), - // [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region_split_size` (or a + // When Region [a,e) size exceeds `region-max-size`, it will be split into several Regions [a,b), + // [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region-split-size` (or a // little larger). See also: region-split-size // Optional: Defaults to 144MB // optional RegionMaxSize string `json:"region-max-size,omitempty" toml:"region-max-size,omitempty"` - // When Region [a,e) size exceeds `region_max_size`, it will be split into several Regions [a,b), - // [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region_split_size` (or a + // When Region [a,e) size exceeds `region-max-size`, it will be split into several Regions [a,b), + // [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region-split-size` (or a // little larger). See also: region-max-size // Optional: Defaults to 96MB // optional RegionSplitSize string `json:"region-split-size,omitempty" toml:"region-split-size,omitempty"` - // When the number of keys in Region [a,e) exceeds the `region_max_keys`, it will be split into + // When the number of keys in Region [a,e) exceeds the `region-max-keys`, it will be split into // several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be - // `region_split_keys`. See also: region-split-keys + // `region-split-keys`. See also: region-split-keys // Optional: Defaults to 1440000 // optional RegionMaxKeys *int64 `json:"region-max-keys,omitempty" toml:"region-max-keys,omitempty"` - // When the number of keys in Region [a,e) exceeds the `region_max_keys`, it will be split into + // When the number of keys in Region [a,e) exceeds the `region-max-keys`, it will be split into // several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be - // `region_split_keys`. See also: region-max-keys + // `region-split-keys`. See also: region-max-keys // Optional: Defaults to 960000 // optional RegionSplitKeys *int64 `json:"region-split-keys,omitempty" toml:"region-split-keys,omitempty"` diff --git a/pkg/apis/pingcap/v1alpha1/tikv_config_test.go b/pkg/apis/pingcap/v1alpha1/tikv_config_test.go new file mode 100644 index 0000000000..e9841be924 --- /dev/null +++ b/pkg/apis/pingcap/v1alpha1/tikv_config_test.go @@ -0,0 +1,71 @@ +// Copyright 2020 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1alpha1 + +import ( + "bytes" + "encoding/json" + "testing" + + "github.com/BurntSushi/toml" + . "github.com/onsi/gomega" + "k8s.io/utils/pointer" +) + +func TestTiKVConfig(t *testing.T) { + g := NewGomegaWithT(t) + c := &TiKVConfig{ + ReadPool: &TiKVReadPoolConfig{ + Storage: &TiKVStorageReadPoolConfig{ + HighConcurrency: pointer.Int64Ptr(4), + }, + Coprocessor: &TiKVCoprocessorReadPoolConfig{ + HighConcurrency: pointer.Int64Ptr(8), + }, + }, + Storage: &TiKVStorageConfig{ + BlockCache: &TiKVBlockCacheConfig{ + Shared: pointer.BoolPtr(true), + }, + }, + } + jsonStr, err := json.Marshal(c) + g.Expect(err).To(Succeed()) + g.Expect(jsonStr).NotTo(ContainSubstring("port"), "Expected empty fields to be omitted") + var jsonUnmarshaled TiKVConfig + err = json.Unmarshal(jsonStr, &jsonUnmarshaled) + g.Expect(err).To(Succeed()) + g.Expect(&jsonUnmarshaled).To(Equal(c)) + + buff := new(bytes.Buffer) + encoder := toml.NewEncoder(buff) + err = encoder.Encode(c) + g.Expect(err).To(Succeed()) + tStr := buff.String() + g.Expect(tStr).To((Equal(`[storage] + [storage.block-cache] + shared = true + +[readpool] + [readpool.coprocessor] + high-concurrency = 8 + [readpool.storage] + high-concurrency = 4 +`))) + + var tUnmarshaled TiKVConfig + err = toml.Unmarshal([]byte(tStr), &tUnmarshaled) + g.Expect(err).To(Succeed()) + g.Expect(&tUnmarshaled).To(Equal(c)) +}