Skip to content

Commit

Permalink
tikv: fixed some description about --db and compact-cluster (#14576)
Browse files Browse the repository at this point in the history
  • Loading branch information
hfxsd authored Aug 22, 2023
1 parent 29ffcad commit d58d2ad
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tikv-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ Use the `compact` command to manually compact data of each TiKV.

- Use the `--from` and `--to` options to specify the compaction range in the form of escaped raw key. If not set, the whole range will be compacted.
- Use the `--region` option to compact the range of a specific region. If set, `--from` and `--to` will be ignored.
- Use the `--db` option to specify the RocksDB that performs compaction. The optional values are `kv` and `raft`.
- Use the `-c` option to specify the column family name. The default value is `default`. The optional values are `default`, `lock`, and `write`.
- Use the `-d` option to specify the RocksDB that performs compaction. The default value is `kv`. The optional values are `kv` and `raft`.
- Use the `--threads` option allows you to specify the concurrency for the TiKV compaction and its default value is `8`. Generally, a higher concurrency comes with a faster compaction speed, which might yet affect the service. You need to choose an appropriate concurrency count based on your scenario.
- Use the `--bottommost` option to include or exclude the bottommost files when TiKV performs compaction. The value options are `default`, `skip`, and `force`. The default value is `default`.
- `default` means that the bottommost files are included only when the Compaction Filter feature is enabled.
Expand All @@ -310,18 +311,21 @@ Use the `compact` command to manually compact data of each TiKV.
- To compact data in the local mode, use the following command:

```shell
tikv-ctl --data-dir /path/to/tikv compact --db kv
tikv-ctl --data-dir /path/to/tikv compact -d kv
```

- To compact data in the remote mode, use the following command:

```shell
tikv-ctl --host ip:port compact --db kv
tikv-ctl --host ip:port compact -d kv
```

### Compact data of the whole TiKV cluster manually

Use the `compact-cluster` command to manually compact data of the whole TiKV cluster. The flags of this command have the same meanings and usage as those of the `compact` command.
Use the `compact-cluster` command to manually compact data of the whole TiKV cluster. The flags of this command have the same meanings and usage as those of the `compact` command. The only difference is as follows:

- For the `compact-cluster` command, use `--pd` to specify the address of the PD, so that `tikv-ctl` can locate all TiKV nodes in the cluster as the compact target.
- For the `compact` command, use `--data-dir` or `--host` to specify a single TiKV as the compact target.

### Set a Region to tombstone

Expand Down

0 comments on commit d58d2ad

Please sign in to comment.