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

tikv-control: make a parameter in right places #9549

Merged
merged 8 commits into from
Oct 11, 2022
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 15 additions & 5 deletions tikv-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,28 @@ The properties can be used to check whether the Region is healthy or not. If not

### Compact data of each TiKV manually

Use the `compact` command to manually compact data of each TiKV. If you specify the `--from` and `--to` options, then their flags are also in the form of escaped raw key.
Use the `compact` command to manually compact data of each TiKV.

- Use the `--host` option to specify the TiKV that needs to perform compaction.
- Use the `-d` option to specify the RocksDB that performs compaction. The optional values are `kv` and `raft`.
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved
- 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`.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
- 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.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
- 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.
- `skip` means that the bottommost files are excluded when TiKV performs compaction.
- `force` means that the bottommost files are always included when TiKV performs compaction.

```bash
$ tikv-ctl --data-dir /path/to/tikv compact -d kv
- To compact data in the local mode, use the following command:

```shell
$ tikv-ctl --data-dir /path/to/tikv compact --db kv
success!
```
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved

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

```shell
$ tikv-ctl --host ip:port compact --db kv
success!
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
```
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved

Expand Down