Does tidb_gc_run_interval control the frequency of resolve locks tasks in tikv gc?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tikv gc 中 tidb_gc_run_interval 是否控制resolve locks任务的启动频率?

| username: Qiuchi

[Test Environment] TiDB
[TiDB Version] 6.5.0
[Reproduction Path] Operations that led to the issue
Resolved by upgrading: txn: unexpected high frequency gc · Issue #40759 · pingcap/tidb (github.com)

It was found that tidb_gc_run_interval seems to only affect the interval of gc safe point advancement. In TiDB, delete ranges and resolve locks still execute at fixed intervals. Even if gc is turned off, gc_worker will still perform these two operations, consistently occupying a portion of TiKV’s CPU resources. Are these two operations bound to gc? Can their execution intervals be adjusted?



| username: zhaokede | Original post link

In TiDB’s GC (Garbage Collection) mechanism, tidb_gc_run_interval is a system variable primarily used to control the interval at which GC runs, rather than directly controlling the frequency of Resolve Locks tasks.

| username: Qiuchi | Original post link

But isn’t Resolve Locks a specific implementation stage in the GC process? If the GC parameters don’t control this frequency, where can it be set?
GC Mechanism Overview | PingCAP Documentation Center

| username: TIDB-Learner | Original post link

The interval time affects the frequency of GC execution, and whether it will be executed depends on the specific situation. For example, if there are long transactions, it will not proceed under the principle of ensuring data safety and integrity. Remember to judge based on the execution time of the transactions. :face_with_peeking_eye: Refer to the relevant documentation for details.