Skip to content

Commit 0f6cf83

Browse files
authored
v8.5.4: tikv: update auto compaction config (#21228) (#21240)
1 parent 4fcded9 commit 0f6cf83

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

garbage-collection-configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@ show config where type = 'tikv' and name like '%enable-compaction-filter%';
9191
> 在使用 Compaction Filter 机制时,可能会出现 GC 进度延迟的情况,从而影响 TiKV 扫描性能。当你的负载中含有大量 coprocessor 请求,并且在 [**TiKV-Details > Coprocessor Detail**](/grafana-tikv-dashboard.md#coprocessor-detail) 面板中发现 Total Ops Details 的 `next()``prev()` 调用次数远远超过 `processed_keys` 调用的三倍时,可以采取以下措施:
9292
>
9393
> - 对于 TiDB v7.1.3 之前版本,建议尝试关闭 Compaction Filter,以加快 GC 速度。
94-
> - 在 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。
95-
> - 从 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-版本开始引入)[`gc.auto-compaction.redundant-rows-percent-threshold`](/tikv-configuration-file.md#redundant-rows-percent-threshold-从-v757-版本开始引入) 自动触发 compaction。如果遇到上述情况,建议调整这两个参数,无需关闭 Compaction Filter。
94+
> - 在 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。
95+
> - 从 TiDB v7.5.7 和 v8.5.4 开始,[`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-和-v854-版本开始引入)[`gc.auto-compaction.redundant-rows-percent-threshold`](/tikv-configuration-file.md#redundant-rows-percent-threshold-从-v757-和-v854-版本开始引入) 自动触发 compaction。如果遇到上述情况,建议调整这两个参数,无需关闭 Compaction Filter。

tikv-configuration-file.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ raftstore 相关的配置项。
792792

793793
> **警告:**
794794
>
795-
> 从 v7.5.7 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.check-interval`](#check-interval-从-v757-版本开始引入) 代替。
795+
> 从 v7.5.7 和 v8.5.4 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.check-interval`](#check-interval-从-v757-和-v854-版本开始引入) 代替。
796796
797797
+ 检查是否需要人工触发 RocksDB compaction 的时间间隔,0 表示不启用。
798798
+ 默认值:5m
@@ -802,7 +802,7 @@ raftstore 相关的配置项。
802802

803803
> **警告:**
804804
>
805-
> 从 v7.5.7 开始,该配置项被废弃。
805+
> 从 v7.5.7 和 v8.5.4 开始,该配置项被废弃。
806806
807807
+ 每轮校验人工 compaction 时,一次性检查的 Region 个数。
808808
+ 默认值:
@@ -813,7 +813,7 @@ raftstore 相关的配置项。
813813

814814
> **警告:**
815815
>
816-
> 从 v7.5.7 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-num-threshold`](#tombstone-num-threshold-从-v757-版本开始引入) 代替。
816+
> 从 v7.5.7 和 v8.5.4 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-num-threshold`](#tombstone-num-threshold-从-v757-和-v854-版本开始引入) 代替。
817817
818818
+ 触发 RocksDB compaction 需要的 tombstone 个数。
819819
+ 默认值:10000
@@ -823,7 +823,7 @@ raftstore 相关的配置项。
823823

824824
> **警告:**
825825
>
826-
> 从 v7.5.7 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-percent-threshold`](#tombstone-percent-threshold-从-v757-版本开始引入) 代替。
826+
> 从 v7.5.7 和 v8.5.4 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-percent-threshold`](#tombstone-percent-threshold-从-v757-和-v854-版本开始引入) 代替。
827827
828828
+ 触发 RocksDB compaction 需要的 tombstone 所占比例。
829829
+ 默认值:30
@@ -834,7 +834,7 @@ raftstore 相关的配置项。
834834

835835
> **警告:**
836836
>
837-
> 从 v7.5.7 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-threshold`](#redundant-rows-threshold-从-v757-版本开始引入) 代替。
837+
> 从 v7.5.7 和 v8.5.4 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-threshold`](#redundant-rows-threshold-从-v757-和-v854-版本开始引入) 代替。
838838
839839
+ 触发 RocksDB compaction 需要的冗余的 MVCC 数据行数。
840840
+ 默认值:`50000`
@@ -844,7 +844,7 @@ raftstore 相关的配置项。
844844

845845
> **警告:**
846846
>
847-
> 从 v7.5.7 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-percent-threshold`](#redundant-rows-percent-threshold-从-v757-版本开始引入) 代替。
847+
> 从 v7.5.7 和 v8.5.4 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-percent-threshold`](#redundant-rows-percent-threshold-从-v757-和-v854-版本开始引入) 代替。
848848
849849
+ 触发 RocksDB compaction 需要的冗余的 MVCC 数据行所占比例。
850850
+ 默认值:`20`
@@ -2258,42 +2258,42 @@ Raft Engine 相关的配置项。
22582258

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

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

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

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

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)