Skip to content

txn: unexpected high frequency gc #40759

@cfzjywxk

Description

@cfzjywxk

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Enable https://github.com/tikv/tikv/blob/master/etc/config-template.toml#L1206 with TiDB v6.5.

2. What did you expect to see? (Required)

The GC resolve lock frequency is the same as the previous versions, the related request number will not surge.

3. What did you see instead (Required)

The kv scan lock requests surge after upgrading to release v6.5.0.
After enabling https://github.com/tikv/tikv/blob/master/etc/config-template.toml#L1206 with TiDB v6.5.
In a GC interval, several time resolve locks would be triggered.

2023-01-21 15:53:56 | [2023/01/21 07:53:56.976 +00:00] [INFO] [gc_worker.go:1073] ["[gc worker] start resolve locks"]  [safePoint=0]
2023-01-21 15:51:57 | [2023/01/21 07:51:57.167 +00:00] [INFO] [gc_worker.go:1073] ["[gc worker] start resolve locks"]
2023-01-21 15:50:00 | [2023/01/21 07:50:00.927 +00:00] [INFO] [gc_worker.go:1073] ["[gc worker] start resolve locks"]

This is because after enabling the log-backup option, the resolve locks would be triggered though the GC interval is not reached yet, the code is https://github.com/pingcap/tidb/blob/master/store/gcworker/gc_worker.go#L324-L335.

4. What is your TiDB version? (Required)

v6.5.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions