Skip to content

Commit 6ee409a

Browse files
Oreoxmtti-chi-bot
authored andcommitted
This is an automated cherry-pick of pingcap#21228
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
1 parent 4fcded9 commit 6ee409a

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

garbage-collection-configuration.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,10 @@ 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+
<<<<<<< HEAD
9495
> - 在 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。
9596
> - 从 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。
97+
=======
98+
> - 在 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。
99+
> - 从 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。
100+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))

tikv-configuration-file.md

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

793793
> **警告:**
794794
>
795+
<<<<<<< HEAD
795796
> 从 v7.5.7 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.check-interval`](#check-interval-从-v757-版本开始引入) 代替。
797+
=======
798+
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.check-interval`](#check-interval-从-v757v854-和-v900-版本开始引入) 代替。
799+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
796800
797801
+ 检查是否需要人工触发 RocksDB compaction 的时间间隔,0 表示不启用。
798802
+ 默认值:5m
@@ -802,7 +806,11 @@ raftstore 相关的配置项。
802806

803807
> **警告:**
804808
>
809+
<<<<<<< HEAD
805810
> 从 v7.5.7 开始,该配置项被废弃。
811+
=======
812+
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃。
813+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
806814
807815
+ 每轮校验人工 compaction 时,一次性检查的 Region 个数。
808816
+ 默认值:
@@ -813,7 +821,11 @@ raftstore 相关的配置项。
813821

814822
> **警告:**
815823
>
824+
<<<<<<< HEAD
816825
> 从 v7.5.7 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-num-threshold`](#tombstone-num-threshold-从-v757-版本开始引入) 代替。
826+
=======
827+
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-num-threshold`](#tombstone-num-threshold-从-v757v854-和-v900-版本开始引入) 代替。
828+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
817829
818830
+ 触发 RocksDB compaction 需要的 tombstone 个数。
819831
+ 默认值:10000
@@ -823,7 +835,11 @@ raftstore 相关的配置项。
823835

824836
> **警告:**
825837
>
838+
<<<<<<< HEAD
826839
> 从 v7.5.7 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-percent-threshold`](#tombstone-percent-threshold-从-v757-版本开始引入) 代替。
840+
=======
841+
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.tombstone-percent-threshold`](#tombstone-percent-threshold-从-v757v854-和-v900-版本开始引入) 代替。
842+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
827843
828844
+ 触发 RocksDB compaction 需要的 tombstone 所占比例。
829845
+ 默认值:30
@@ -834,7 +850,11 @@ raftstore 相关的配置项。
834850

835851
> **警告:**
836852
>
853+
<<<<<<< HEAD
837854
> 从 v7.5.7 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-threshold`](#redundant-rows-threshold-从-v757-版本开始引入) 代替。
855+
=======
856+
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-threshold`](#redundant-rows-threshold-从-v757v854-和-v900-版本开始引入) 代替。
857+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
838858
839859
+ 触发 RocksDB compaction 需要的冗余的 MVCC 数据行数。
840860
+ 默认值:`50000`
@@ -844,7 +864,11 @@ raftstore 相关的配置项。
844864

845865
> **警告:**
846866
>
867+
<<<<<<< HEAD
847868
> 从 v7.5.7 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-percent-threshold`](#redundant-rows-percent-threshold-从-v757-版本开始引入) 代替。
869+
=======
870+
> 从 v7.5.7、v8.5.4 和 v9.0.0 开始,该配置项被废弃,其功能由 [`gc.auto-compaction.redundant-rows-percent-threshold`](#redundant-rows-percent-threshold-从-v757v854-和-v900-版本开始引入) 代替。
871+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
848872
849873
+ 触发 RocksDB compaction 需要的冗余的 MVCC 数据行所占比例。
850874
+ 默认值:`20`
@@ -2258,42 +2282,74 @@ Raft Engine 相关的配置项。
22582282

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

2285+
<<<<<<< HEAD
22612286
### `check-interval` <span class="version-mark">从 v7.5.7 版本开始引入</span>
2287+
=======
2288+
### `check-interval` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>
2289+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
22622290
22632291
+ TiKV 检查是否需要触发自动 compaction 的时间间隔。在此时间段内,满足自动 compaction 条件的 Region 会按优先级进行处理。当到达此间隔时,TiKV 会重新扫描 Region 信息并重新计算优先级。
22642292
+ 默认值:`"300s"`
22652293

2294+
<<<<<<< HEAD
22662295
### `tombstone-num-threshold` <span class="version-mark">从 v7.5.7 版本开始引入</span>
22672296

22682297
+ 触发 TiKV 自动 compaction 需要的 RocksDB tombstone 个数。当 tombstone 数量达到此阈值,或 tombstone 所占比例达到 [`tombstone-percent-threshold`](#tombstone-percent-threshold-从-v757-版本开始引入) 时,TiKV 将触发自动 compaction。
2298+
=======
2299+
### `tombstone-num-threshold` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>
2300+
2301+
+ 触发 TiKV 自动 compaction 需要的 RocksDB tombstone 个数。当 tombstone 数量达到此阈值,或 tombstone 所占比例达到 [`tombstone-percent-threshold`](#tombstone-percent-threshold-从-v757v854-和-v900-版本开始引入) 时,TiKV 将触发自动 compaction。
2302+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
22692303
+ 仅在关闭 [Compaction Filter](/garbage-collection-configuration.md) 时生效。
22702304
+ 默认值:`10000`
22712305
+ 最小值:`0`
22722306

2307+
<<<<<<< HEAD
22732308
### `tombstone-percent-threshold` <span class="version-mark">从 v7.5.7 版本开始引入</span>
22742309

22752310
+ 触发 TiKV 自动 compaction 需要的 RocksDB tombstone 所占比例。当 tombstone 所占比例达到此阈值,或 tombstone 数量达到 [`tombstone-num-threshold`](#tombstone-num-threshold-从-v757-版本开始引入) 时,TiKV 将触发自动 compaction。
2311+
=======
2312+
### `tombstone-percent-threshold` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>
2313+
2314+
+ 触发 TiKV 自动 compaction 需要的 RocksDB tombstone 所占比例。当 tombstone 所占比例达到此阈值,或 tombstone 数量达到 [`tombstone-num-threshold`](#tombstone-num-threshold-从-v757v854-和-v900-版本开始引入) 时,TiKV 将触发自动 compaction。
2315+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
22762316
+ 仅在关闭 [Compaction Filter](/garbage-collection-configuration.md) 时生效。
22772317
+ 默认值:`30`
22782318
+ 最小值:`0`
22792319
+ 最大值:`100`
22802320

2321+
<<<<<<< HEAD
22812322
### `redundant-rows-threshold` <span class="version-mark">从 v7.5.7 版本开始引入</span>
22822323

22832324
+ 触发 TiKV 自动 compaction 需要的冗余的 MVCC 数据行数,包含 RocksDB tombstone、TiKV stale versions 和 TiKV deletion tombstones。当冗余的 MVCC 数据行数达到此阈值,或这些行数的占比达到 [`redundant-rows-percent-threshold`](#redundant-rows-percent-threshold-从-v757-版本开始引入) 时,TiKV 将触发自动 compaction。
2325+
=======
2326+
### `redundant-rows-threshold` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>
2327+
2328+
+ 触发 TiKV 自动 compaction 需要的冗余的 MVCC 数据行数,包含 RocksDB tombstone、TiKV stale versions 和 TiKV deletion tombstones。当冗余的 MVCC 数据行数达到此阈值,或这些行数的占比达到 [`redundant-rows-percent-threshold`](#redundant-rows-percent-threshold-从-v757v854-和-v900-版本开始引入) 时,TiKV 将触发自动 compaction。
2329+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
22842330
+ 仅在开启 [Compaction Filter](/garbage-collection-configuration.md) 时生效。
22852331
+ 默认值:`50000`
22862332
+ 最小值:`0`
22872333

2334+
<<<<<<< HEAD
22882335
### `redundant-rows-percent-threshold` <span class="version-mark">从 v7.5.7 版本开始引入</span>
22892336

22902337
+ 触发 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。
2338+
=======
2339+
### `redundant-rows-percent-threshold` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>
2340+
2341+
+ 触发 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。
2342+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
22912343
+ 仅在开启 [Compaction Filter](/garbage-collection-configuration.md) 时生效。
22922344
+ 默认值:`20`
22932345
+ 最小值:`0`
22942346
+ 最大值:`100`
22952347

2348+
<<<<<<< HEAD
22962349
### `bottommost-level-force` <span class="version-mark">从 v7.5.7 版本开始引入</span>
2350+
=======
2351+
### `bottommost-level-force` <span class="version-mark">从 v7.5.7、v8.5.4 和 v9.0.0 版本开始引入</span>
2352+
>>>>>>> 436d1fb84c (v8.5.4: tikv: update auto compaction config (#21228))
22972353
22982354
+ 控制是否强制对 RocksDB 最底层文件进行 compaction。
22992355
+ 默认值:`true`

0 commit comments

Comments
 (0)