【 TiDB 使用环境】
3tidb + 3tikv + 3pd
【概述】
版本从5.2.2升级到5.2.3之后,gc-worker 一只报警,看起来像是来不及gc, 请教一些该如何处理?
【背景】
之前一只使用的5.2.2,最近看到各个版本都修正了GCKeys的bug,所以升级到了5.2.3
【现象】
监控报警 TiKV_pending_task,类型gc-worker
- gc_delete_range一直增加
MySQL [(none)]> select count(*) from mysql.gc_delete_range_done;
+----------+
| count(*) |
+----------+
| 814 |
+----------+
1 row in set (0.00 sec)
MySQL [(none)]> select count(*) from mysql.gc_delete_range;
+----------+
| count(*) |
+----------+
| 1990 |
+----------+
1 row in set (0.00 sec)
- tidb.log中出现大量range delete错误, gc workder is too busy
[2022/01/28 11:18:21.036 +09:00] [ERROR] [gc_worker.go:705] ["[gc worker] delete range failed on range"] [uuid=5fa57b4e89c000a] [startKey=7480000000001200a2] [endKey=7480000000001200a3] [error="[gc worker] destroy range finished with errors: [unsafe destroy range failed on store 1: gc worker is too busy unsafe destroy range failed on store 4: gc worker is too busy]"]
[2022/01/28 11:18:21.050 +09:00] [ERROR] [gc_worker.go:705] ["[gc worker] delete range failed on range"] [uuid=5fa57b4e89c000a] [startKey=7480000000001200e9] [endKey=7480000000001200ea] [error="[gc worker] destroy range finished with errors: [unsafe destroy range failed on store 1: gc worker is too busy unsafe destroy range failed on store 4: gc worker is too busy]"]
[2022/01/28 11:18:21.050 +09:00] [INFO] [gc_worker.go:736] ["[gc worker] finish delete ranges"] [uuid=5fa57b4e89c000a] ["num of ranges"=1990] ["cost time"=1.132902063s]
[2022/01/28 11:18:21.078 +09:00] [INFO] [gc_worker.go:759] ["[gc worker] start redo-delete ranges"] [uuid=5fa57b4e89c000a] ["num of ranges"=814]
....
[2022/01/28 11:18:21.519 +09:00] [ERROR] [gc_worker.go:768] ["[gc worker] redo-delete range failed on range"] [uuid=5fa57b4e89c000a] [startKey=74800000000011fb58] [endKey=74800000000011fb59] [error="[gc worker] destroy range finished with errors: [unsafe destroy range failed on store 1: gc worker is too busy unsafe destroy range failed on store 4: gc worker is too busy]"]
[2022/01/28 11:18:21.519 +09:00] [INFO] [gc_worker.go:788] ["[gc worker] finish redo-delete ranges"] [uuid=5fa57b4e89c000a] ["num of ranges"=814] ["cost time"=441.427515ms]
[2022/01/28 11:18:21.523 +09:00] [INFO] [gc_worker.go:1548] ["[gc worker] sent safe point to PD"] [uuid=5fa57b4e89c000a] ["safe point"=430790567310131200]
【业务影响】
业务目前可正常使用
【TiDB 版本】
v5.2.3
GC配置如下
bootstrapped True
tidb_server_version 72
system_tz Asia/Tokyo
new_collation_enabled True
tikv_gc_leader_uuid 5fa57b4e89c000a
tikv_gc_leader_lease 20220128-11:19:39 +0900
tikv_gc_enable true
tikv_gc_run_interval 10m0s
tikv_gc_life_time 10m0s
tikv_gc_last_run_time 20220128-11:16:39 +0900
tikv_gc_safe_point 20220128-11:06:39 +0900
tikv_gc_auto_concurrency true
tikv_gc_scan_lock_mode legacy
tikv_gc_mode distributed
gc.enable-compaction-filter true