Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#12648
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
Oreoxmt authored and ti-chi-bot committed Mar 6, 2023
1 parent e66cb3f commit b90210a
Showing 1 changed file with 272 additions and 1 deletion.
273 changes: 272 additions & 1 deletion tikv-configuration-file.md
Expand Up @@ -676,10 +676,17 @@ Configuration items related to Raftstore
+ Default value: `"9s"`
+ Minimum value: `0`

<<<<<<< HEAD
### `allow-remove-leader`

+ Determines whether to allow deleting the main switch
+ Default value: `false`
=======
### `right-derive-when-split`

+ Specifies the start key of the new Region when a Region is split. When this configuration item is set to `true`, the start key is the maximum split key. When this configuration item is set to `false`, the start key is the original Region's start key.
+ Default value: `true`
>>>>>>> 0184f982b (tikv config: align with Chinese (#12648))
### `merge-max-log-gap`

Expand Down Expand Up @@ -752,7 +759,24 @@ Configuration items related to Raftstore
+ Default value: `"500ms"`
+ Minimum value: `"1ms"`

<<<<<<< HEAD
## Coprocessor
=======
### `raft-write-size-limit` <span class="version-mark">New in v5.3.0</span>

+ Determines the threshold at which Raft data is written into the disk. If the data size is larger than the value of this configuration item, the data is written to the disk. When the value of `store-io-pool-size` is `0`, this configuration item does not take effect.
+ Default value: `1MB`
+ Minimum value: `0`

### `report-min-resolved-ts-interval`

+ Determines the minimum interval at which the resolved timestamp is reported to the PD leader. If this value is set to `0`, it means that the reporting is disabled.
+ Default value: `"1s"`, which is the smallest positive value
+ Minimum value: `0`
+ Unit: second

## coprocessor
>>>>>>> 0184f982b (tikv config: align with Chinese (#12648))
Configuration items related to Coprocessor

Expand Down Expand Up @@ -789,7 +813,54 @@ Configuration items related to Coprocessor
+ The number of keys in the newly split Region. This value is an estimate.
+ Default value: `960000`

<<<<<<< HEAD
## RocksDB
=======
### `consistency-check-method`

+ Specifies the method of data consistency check
+ For the consistency check of MVCC data, set the value to `"mvcc"`. For the consistency check of raw data, set the value to `"raw"`.
+ Default value: `"mvcc"`

## coprocessor-v2

### `coprocessor-plugin-directory`

+ The path of the directory where compiled coprocessor plugins are located. Plugins in this directory are automatically loaded by TiKV.
+ If this configuration item is not set, the coprocessor plugin is disabled.
+ Default value: `"./coprocessors"`

### `enable-region-bucket` <span class="version-mark">New in v6.1.0</span>

+ Determines whether to divide a Region into smaller ranges called buckets. The bucket is used as the unit of the concurrent query to improve the scan concurrency. For more about the design of the bucket, refer to [Dynamic size Region](https://github.com/tikv/rfcs/blob/master/text/0082-dynamic-size-region.md).
+ Default value: false

> **Warning:**
>
> - `enable-region-bucket` is an experimental feature introduced in TiDB v6.1.0. It is not recommended that you use it in production environments.
> - This configuration makes sense only when `region-split-size` is twice of `region-bucket-size` or above; otherwise, no bucket is actually generated.
> - Adjusting `region-split-size` to a larger value might have the risk of performance regression and slow scheduling.
### `region-bucket-size` <span class="version-mark">New in v6.1.0</span>

+ The size of a bucket when `enable-region-bucket` is true.
+ Default value: `96MiB`

> **Warning:**
>
> `region-bucket-size` is an experimental feature introduced in TiDB v6.1.0. It is not recommended that you use it in production environments.
### `report-region-buckets-tick-interval` <span class="version-mark">New in v6.1.0</span>

> **Warning:**
>
> `report-region-buckets-tick-interval` is an experimental feature introduced in TiDB v6.1.0. It is not recommended that you use it in production environments.
+ The interval at which TiKV reports bucket information to PD when `enable-region-bucket` is true.
+ Default value: `10s`

## rocksdb
>>>>>>> 0184f982b (tikv config: align with Chinese (#12648))
Configuration items related to RocksDB

Expand Down Expand Up @@ -1125,9 +1196,19 @@ Configuration items related to `rocksdb.defaultcf`, `rocksdb.writecf`, and `rock
### `compaction-pri`

+ The priority type of compaction
<<<<<<< HEAD
+ Optional values: `0` (`ByCompensatedSize`), `1` (`OldestLargestSeqFirst`), `2` (`OldestSmallestSeqFirst`), `3` (`MinOverlappingRatio`)
+ Default value for `defaultcf` and `writecf`: `3`
+ Default value for `lockcf`: `0`
=======
+ Optional values:
- `"by-compensated-size"`: compact files in order of file size and large files are compacted with higher priority.
- `"oldest-largest-seq-first"`: prioritize compaction on files with the oldest update time. Use this value **only** when updating hot keys in small ranges.
- `"oldest-smallest-seq-first"`: prioritize compaction on files with ranges that are not compacted to the next level for a long time. If you randomly update hot keys across the key space, this value can slightly reduce write amplification.
- `"min-overlapping-ratio"`: prioritize compaction on files with a high overlap ratio. When a file is small in different levels (the result of `the file size in the next level` ÷ `the file size in this level` is small), TiKV compacts this file first. In many cases, this value can effectively reduce write amplification.
+ Default value for `defaultcf` and `writecf`: `"min-overlapping-ratio"`
+ Default value for `lockcf`: `"by-compensated-size"`
>>>>>>> 0184f982b (tikv config: align with Chinese (#12648))
### `dynamic-level-bytes`

Expand Down Expand Up @@ -1281,8 +1362,198 @@ Configuration items related to `raftdb`

### `wal-dir`

<<<<<<< HEAD
+ The directory in which WAL files are stored
+ Default value: `"/tmp/tikv/store"`
=======
+ The directory in which Raft RocksDB WAL files are stored, which is the absolute directory path for WAL. **Do not** set this configuration item to the same value as [`rocksdb.wal-dir`](#wal-dir).
+ If this configuration item is not set, the log files are stored in the same directory as data.
+ If there are two disks on the machine, storing RocksDB data and WAL logs on different disks can improve performance.
+ Default value: `""`

### `wal-ttl-seconds`

+ Specifies how long the archived WAL files are retained. When the value is exceeded, the system deletes these files.
+ Default value: `0`
+ Minimum value: `0`
+ Unit: second

### `wal-size-limit`

+ The size limit of the archived WAL files. When the value is exceeded, the system deletes these files.
+ Default value: `0`
+ Minimum value: `0`
+ Unit: B|KB|MB|GB

### `max-total-wal-size`

+ The maximum RocksDB WAL size in total
+ Default value: `"4GB"`

### `compaction-readahead-size`

+ Controls whether to enable the readahead feature during RocksDB compaction and specify the size of readahead data.
+ If you use mechanical disks, it is recommended to set the value to `2MB` at least.
+ Default value: `0`
+ Minimum value: `0`
+ Unit: B|KB|MB|GB

### `writable-file-max-buffer-size`

+ The maximum buffer size used in WritableFileWrite
+ Default value: `"1MB"`
+ Minimum value: `0`
+ Unit: B|KB|MB|GB

### `use-direct-io-for-flush-and-compaction`

+ Determines whether to use `O_DIRECT` for both reads and writes in the background flush and compactions. The performance impact of this option: enabling `O_DIRECT` bypasses and prevents contamination of the OS buffer cache, but the subsequent file reads require re-reading the contents to the buffer cache.
+ Default value: `false`

### `enable-pipelined-write`

+ Controls whether to enable Pipelined Write. When this configuration is enabled, the previous Pipelined Write is used. When this configuration is disabled, the new Pipelined Commit mechanism is used.
+ Default value: `true`

### `allow-concurrent-memtable-write`

+ Controls whether to enable concurrent memtable write.
+ Default value: `true`

### `bytes-per-sync`

+ The rate at which OS incrementally synchronizes files to disk while these files are being written asynchronously
+ Default value: `"1MB"`
+ Minimum value: `0`
+ Unit: B|KB|MB|GB

### `wal-bytes-per-sync`

+ The rate at which OS incrementally synchronizes WAL files to disk when the WAL files are being written
+ Default value: `"512KB"`
+ Minimum value: `0`
+ Unit: B|KB|MB|GB

### `info-log-max-size`

+ The maximum size of Info logs
+ Default value: `"1GB"`
+ Minimum value: `0`
+ Unit: B|KB|MB|GB

### `info-log-roll-time`

+ The interval at which Info logs are truncated. If the value is `0s`, logs are not truncated.
+ Default value: `"0s"` (which means logs are not truncated)

### `info-log-keep-log-file-num`

+ The maximum number of Info log files kept in RaftDB
+ Default value: `10`
+ Minimum value: `0`

### `info-log-dir`

+ The directory in which Info logs are stored
+ Default value: `""`

### `info-log-level`

+ Log levels of RaftDB
+ Default value: `"info"`

## raft-engine

Configuration items related to Raft Engine.

> **Note:**
>
> - When you enable Raft Engine for the first time, TiKV transfers its data from RocksDB to Raft Engine. Therefore, you need to wait extra tens of seconds for TiKV to start.
> - The data format of Raft Engine in TiDB v5.4.0 is not compatible with earlier TiDB versions. Therefore, if you need to downgrade a TiDB cluster from v5.4.0 to an earlier version, **before** downgrading, disable Raft Engine by setting `enable` to `false` and restart TiKV for the configuration to take effect.
### `enable`

+ Determines whether to use Raft Engine to store Raft logs. When it is enabled, configurations of `raftdb` are ignored.
+ Default value: `true`

### `dir`

+ The directory at which raft log files are stored. If the directory does not exist, it will be created when TiKV is started.
+ If this configuration item is not set, `{data-dir}/raft-engine` is used.
+ If there are multiple disks on your machine, it is recommended to store the data of Raft Engine on a different disk to improve TiKV performance.
+ Default value: `""`

### `batch-compression-threshold`

+ Specifies the threshold size of a log batch. A log batch larger than this configuration is compressed. If you set this configuration item to `0`, compression is disabled.
+ Default value: `"8KB"`

### `bytes-per-sync`

+ Specifies the maximum accumulative size of buffered writes. When this configuration value is exceeded, buffered writes are flushed to the disk.
+ If you set this configuration item to `0`, incremental sync is disabled.
+ Default value: `"4MB"`

### `target-file-size`

+ Specifies the maximum size of log files. When a log file is larger than this value, it is rotated.
+ Default value: `"128MB"`

### `purge-threshold`

+ Specifies the threshold size of the main log queue. When this configuration value is exceeded, the main log queue is purged.
+ This configuration can be used to adjust the disk space usage of Raft Engine.
+ Default value: `"10GB"`

### `recovery-mode`

+ Determines how to deal with file corruption during recovery.
+ Value options: `"absolute-consistency"`, `"tolerate-tail-corruption"`, `"tolerate-any-corruption"`
+ Default value: `"tolerate-tail-corruption"`

### `recovery-read-block-size`

+ The minimum I/O size for reading log files during recovery.
+ Default value: `"16KB"`
+ Minimum value: `"512B"`

### `recovery-threads`

+ The number of threads used to scan and recover log files.
+ Default value: `4`
+ Minimum value: `1`

### `memory-limit`

+ Specifies the limit on the memory usage of Raft Engine.
+ When this configuration value is not set, 15% of the available system memory is used.
+ Default value: `Total machine memory * 15%`

### `format-version` <span class="version-mark">New in v6.3.0</span>

> **Note:**
>
> After `format-version` is set to `2`, if you need to downgrade a TiKV cluster from v6.3.0 to an earlier version, take the following steps **before** the downgrade:
>
> 1. Disable Raft Engine by setting [`enable`](/tikv-configuration-file.md#enable-1) to `false` and restart TiKV to make the configuration take effect.
> 2. Set `format-version` to `1`.
> 3. Enable Raft Engine by setting `enable` to `true` and restart TiKV to make the configuration take effect.
+ Specifies the version of log files in Raft Engine.
+ Value Options:
+ `1`: Default log file version for TiKV earlier than v6.3.0. Can be read by TiKV >= v6.1.0.
+ `2`: Supports log recycling. Can be read by TiKV >= v6.3.0.
+ Default value: `2`

### `enable-log-recycle` <span class="version-mark">New in v6.3.0</span>

> **Note:**
>
> This configuration item is only available when [`format-version`](#format-version-new-in-v630) >= 2.
+ Determines whether to recycle stale log files in Raft Engine. When it is enabled, logically purged log files will be reserved for recycling. This reduces the long tail latency on write workloads.
+ Default value: `false`
>>>>>>> 0184f982b (tikv config: align with Chinese (#12648))
## security

Expand Down Expand Up @@ -1338,7 +1609,7 @@ Configuration items related to [encryption at rest](/encryption-at-rest.md) (TDE

+ Specifies the old master key when rotating the new master key. The configuration format is the same as that of `master-key`. To learn how to configure a master key, see [Encryption at Rest - Configure encryption](/encryption-at-rest.md#configure-encryption).

## `import`
## import

Configuration items related to TiDB Lightning import and BR restore.

Expand Down

0 comments on commit b90210a

Please sign in to comment.