Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions garbage-collection-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ show config where type = 'tikv' and name like '%enable-compaction-filter%';
> 在使用 Compaction Filter 机制时,可能会出现 GC 进度延迟的情况,从而影响 TiKV 扫描性能。当你的负载中含有大量 coprocessor 请求,并且在 [**TiKV-Details > Coprocessor Detail**](/grafana-tikv-dashboard.md#coprocessor-detail) 面板中发现 Total Ops Details 的 `next()` 或 `prev()` 调用次数远远超过 `processed_keys` 调用的三倍时,可以采取以下措施:
>
> - 对于 TiDB v7.1.3 之前版本,建议尝试关闭 Compaction Filter,以加快 GC 速度。
> - 在 TiDB v7.1.3 v7.5.6 及其之间的版本中,TiDB 会根据每个 Region 的冗余版本数量 [`region-compact-min-redundant-rows`](/tikv-configuration-file.md#region-compact-min-redundant-rows-从-v710-版本开始引入) 和比例 [`region-compact-redundant-rows-percent`](/tikv-configuration-file.md#region-compact-redundant-rows-percent-从-v710-版本开始引入) 自动触发 compaction,从而提高 Compaction Filter 的 GC 速度。如果遇到上述情况,建议调整这两个参数,无需关闭 Compaction Filter。
> - 从 TiDB v7.5.7 开始,[`region-compact-min-redundant-rows`](/tikv-configuration-file.md#region-compact-min-redundant-rows-从-v710-版本开始引入) 和 [`region-compact-redundant-rows-percent`](/tikv-configuration-file.md#region-compact-redundant-rows-percent-从-v710-版本开始引入) 已废弃,TiDB 会根据 [`gc.auto-compaction.redundant-rows-threshold`](/tikv-configuration-file.md#redundant-rows-threshold-从-v757-和-v900-版本开始引入) 和 [`gc.auto-compaction.redundant-rows-percent-threshold`](/tikv-configuration-file.md#redundant-rows-percent-threshold-从-v757-和-v900-版本开始引入) 自动触发 compaction。如果遇到上述情况,建议调整这两个参数,无需关闭 Compaction Filter。
> - 在 TiDB v7.1.3 v7.5.6,以及 v7.6.0 至 v8.5.3 的版本中,TiDB 会根据每个 Region 的冗余版本数量 [`region-compact-min-redundant-rows`](/tikv-configuration-file.md#region-compact-min-redundant-rows-从-v710-版本开始引入) 和比例 [`region-compact-redundant-rows-percent`](/tikv-configuration-file.md#region-compact-redundant-rows-percent-从-v710-版本开始引入) 自动触发 compaction,从而提高 Compaction Filter 的 GC 速度。如果遇到上述情况,建议调整这两个参数,无需关闭 Compaction Filter。
> - 从 TiDB v7.5.7、v8.5.4 和 v9.0.0 开始,[`region-compact-min-redundant-rows`](/tikv-configuration-file.md#region-compact-min-redundant-rows-从-v710-版本开始引入) 和 [`region-compact-redundant-rows-percent`](/tikv-configuration-file.md#region-compact-redundant-rows-percent-从-v710-版本开始引入) 已废弃,TiDB 会根据 [`gc.auto-compaction.redundant-rows-threshold`](/tikv-configuration-file.md#redundant-rows-threshold-从-v757v854-和-v900-版本开始引入) 和 [`gc.auto-compaction.redundant-rows-percent-threshold`](/tikv-configuration-file.md#redundant-rows-percent-threshold-从-v757v854-和-v900-版本开始引入) 自动触发 compaction。如果遇到上述情况,建议调整这两个参数,无需关闭 Compaction Filter。
32 changes: 16 additions & 16 deletions tikv-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ raftstore 相关的配置项。

> **警告:**
>
> 从 v7.5.7 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.check-interval`](#check-interval-从-v757-和-v900-版本开始引入) 代替。
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.check-interval`](#check-interval-从-v757v854-和-v900-版本开始引入) 代替。

+ 检查是否需要人工触发 RocksDB compaction 的时间间隔,0 表示不启用。
+ 默认值:5m
Expand All @@ -830,7 +830,7 @@ raftstore 相关的配置项。

> **警告:**
>
> 从 v7.5.7 和 v9.0.0 开始,该配置项被废弃。
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃。

+ 每轮校验人工 compaction 时,一次性检查的 Region 个数。
+ 默认值:
Expand All @@ -841,7 +841,7 @@ raftstore 相关的配置项。

> **警告:**
>
> 从 v7.5.7 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-num-threshold`](#tombstone-num-threshold-从-v757-和-v900-版本开始引入) 代替。
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-num-threshold`](#tombstone-num-threshold-从-v757v854-和-v900-版本开始引入) 代替。

+ 触发 RocksDB compaction 需要的 tombstone 个数。
+ 默认值:10000
Expand All @@ -851,7 +851,7 @@ raftstore 相关的配置项。

> **警告:**
>
> 从 v7.5.7 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-percent-threshold`](#tombstone-percent-threshold-从-v757-和-v900-版本开始引入) 代替。
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-percent-threshold`](#tombstone-percent-threshold-从-v757v854-和-v900-版本开始引入) 代替。

+ 触发 RocksDB compaction 需要的 tombstone 所占比例。
+ 默认值:30
Expand All @@ -862,7 +862,7 @@ raftstore 相关的配置项。

> **警告:**
>
> 从 v7.5.7 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-threshold`](#redundant-rows-threshold-从-v757-和-v900-版本开始引入) 代替。
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-threshold`](#redundant-rows-threshold-从-v757v854-和-v900-版本开始引入) 代替。

+ 触发 RocksDB compaction 需要的冗余的 MVCC 数据行数。
+ 默认值:`50000`
Expand All @@ -872,7 +872,7 @@ raftstore 相关的配置项。

> **警告:**
>
> 从 v7.5.7 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-percent-threshold`](#redundant-rows-percent-threshold-从-v757-和-v900-版本开始引入) 代替。
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-percent-threshold`](#redundant-rows-percent-threshold-从-v757v854-和-v900-版本开始引入) 代替。

+ 触发 RocksDB compaction 需要的冗余的 MVCC 数据行所占比例。
+ 默认值:`20`
Expand Down Expand Up @@ -2286,42 +2286,42 @@ Raft Engine 相关的配置项。

用于配置 TiKV 自动 compaction 的行为。

### `check-interval` <span class="version-mark">从 v7.5.7 和 v9.0.0 版本开始引入</span>
### `check-interval` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>

+ TiKV 检查是否需要触发自动 compaction 的时间间隔。在此时间段内,满足自动 compaction 条件的 Region 会按优先级进行处理。当到达此间隔时,TiKV 会重新扫描 Region 信息并重新计算优先级。
+ 默认值:`"300s"`

### `tombstone-num-threshold` <span class="version-mark">从 v7.5.7 和 v9.0.0 版本开始引入</span>
### `tombstone-num-threshold` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>

+ 触发 TiKV 自动 compaction 需要的 RocksDB tombstone 个数。当 tombstone 数量达到此阈值,或 tombstone 所占比例达到 [`tombstone-percent-threshold`](#tombstone-percent-threshold-从-v757-和-v900-版本开始引入) 时,TiKV 将触发自动 compaction。
+ 触发 TiKV 自动 compaction 需要的 RocksDB tombstone 个数。当 tombstone 数量达到此阈值,或 tombstone 所占比例达到 [`tombstone-percent-threshold`](#tombstone-percent-threshold-从-v757v854-和-v900-版本开始引入) 时,TiKV 将触发自动 compaction。
+ 仅在关闭 [Compaction Filter](/garbage-collection-configuration.md) 时生效。
+ 默认值:`10000`
+ 最小值:`0`

### `tombstone-percent-threshold` <span class="version-mark">从 v7.5.7 和 v9.0.0 版本开始引入</span>
### `tombstone-percent-threshold` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>

+ 触发 TiKV 自动 compaction 需要的 RocksDB tombstone 所占比例。当 tombstone 所占比例达到此阈值,或 tombstone 数量达到 [`tombstone-num-threshold`](#tombstone-num-threshold-从-v757-和-v900-版本开始引入) 时,TiKV 将触发自动 compaction。
+ 触发 TiKV 自动 compaction 需要的 RocksDB tombstone 所占比例。当 tombstone 所占比例达到此阈值,或 tombstone 数量达到 [`tombstone-num-threshold`](#tombstone-num-threshold-从-v757v854-和-v900-版本开始引入) 时,TiKV 将触发自动 compaction。
+ 仅在关闭 [Compaction Filter](/garbage-collection-configuration.md) 时生效。
+ 默认值:`30`
+ 最小值:`0`
+ 最大值:`100`

### `redundant-rows-threshold` <span class="version-mark">从 v7.5.7 和 v9.0.0 版本开始引入</span>
### `redundant-rows-threshold` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>

+ 触发 TiKV 自动 compaction 需要的冗余的 MVCC 数据行数,包含 RocksDB tombstone、TiKV stale versions 和 TiKV deletion tombstones。当冗余的 MVCC 数据行数达到此阈值,或这些行数的占比达到 [`redundant-rows-percent-threshold`](#redundant-rows-percent-threshold-从-v757-和-v900-版本开始引入) 时,TiKV 将触发自动 compaction。
+ 触发 TiKV 自动 compaction 需要的冗余的 MVCC 数据行数,包含 RocksDB tombstone、TiKV stale versions 和 TiKV deletion tombstones。当冗余的 MVCC 数据行数达到此阈值,或这些行数的占比达到 [`redundant-rows-percent-threshold`](#redundant-rows-percent-threshold-从-v757v854-和-v900-版本开始引入) 时,TiKV 将触发自动 compaction。
+ 仅在开启 [Compaction Filter](/garbage-collection-configuration.md) 时生效。
+ 默认值:`50000`
+ 最小值:`0`

### `redundant-rows-percent-threshold` <span class="version-mark">从 v7.5.7 和 v9.0.0 版本开始引入</span>
### `redundant-rows-percent-threshold` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>

+ 触发 TiKV 自动 compaction 需要的冗余的 MVCC 数据行数所占比例。冗余数据包含 RocksDB tombstone、TiKV stale versions 和 TiKV deletion tombstones。当冗余的 MVCC 数据行数达到 [`redundant-rows-threshold`](#redundant-rows-threshold-从-v757-和-v900-版本开始引入),或这些行数的占比达到 `redundant-rows-percent-threshold` 时,TiKV 将触发自动 compaction。
+ 触发 TiKV 自动 compaction 需要的冗余的 MVCC 数据行数所占比例。冗余数据包含 RocksDB tombstone、TiKV stale versions 和 TiKV deletion tombstones。当冗余的 MVCC 数据行数达到 [`redundant-rows-threshold`](#redundant-rows-threshold-从-v757v854-和-v900-版本开始引入),或这些行数的占比达到 `redundant-rows-percent-threshold` 时,TiKV 将触发自动 compaction。
+ 仅在开启 [Compaction Filter](/garbage-collection-configuration.md) 时生效。
+ 默认值:`20`
+ 最小值:`0`
+ 最大值:`100`

### `bottommost-level-force` <span class="version-mark">从 v7.5.7 和 v9.0.0 版本开始引入</span>
### `bottommost-level-force` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>

+ 控制是否强制对 RocksDB 最底层文件进行 compaction。
+ 默认值:`true`
Expand Down