【TiDB 版本】: v4.0.10
【问题描述】: 在執行前端MySQL & TiDB資料比對(sync-diff-inspector)時,alertmanager頻繁發出 [TiDB tikvclient_backoff_count error]告警訊息
想請問顧問我們應該怎麼調整TiKV才能避免此告警?
【sync-diff-inspector執行時間區間】:
(用checksum方式檢查)
2021/02/03 17:50:03 - 2021/02/04 03:06:23
檢查的資料庫大小約303G
303G ./mysql/data/{database_name}
【sync-diff-inspector config檔案】:
config.toml (4.0 KB)
【Promethesus tidb.rules.yml】:
-
alert: TiDB_tikvclient_region_err_total
expr: increase( tidb_tikvclient_region_err_total[10m] ) > 6000
for: 1m
labels:
env: ENV_LABELS_ENV
level: emergency
expr: increase( tidb_tikvclient_region_err_total[10m] ) > 6000
annotations:
description: ‘cluster: ENV_LABELS_ENV, instance: {{ $labels.instance }}, values:{{ $value }}’
value: ‘{{ $value }}’
summary: TiDB tikvclient_backoff_count error -
alert: tidb_tikvclient_backoff_seconds_count
expr: increase( tidb_tikvclient_backoff_seconds_count[10m] ) > 10
for: 1m
labels:
env: ENV_LABELS_ENV
level: warning
expr: increase( tidb_tikvclient_backoff_seconds_count[10m] ) > 10
annotations:
description: ‘cluster: ENV_LABELS_ENV, instance: {{ $labels.instance }}, values:{{ $value }}’
value: ‘{{ $value }}’
summary: TiDB tikvclient_backoff_count error
【告警訊息】: 172.31.13.101為TiDB節點
【TiDB Error Log】:
tidb_kv_error.log (31.4 KB)
舉列log內錯誤:
1.
[ERROR] [distsql.go:1131] [“table reader fetch next chunk failed”]
2.
[ERROR] [terror.go:291] [“encountered error”] [error=“write tcp 172.31.13.101:4000->60.251.54.196:63219: write: connection reset by peer”]
3.
[ERROR] [misc.go:115] [“panic in the recoverable goroutine”]
4.
[ERROR] [expr_to_pb.go:133] [“encode decimal”] [error=“[types:8029]Bad Number”]
【Grafana監控】
【TiDB監控面板 - KV Errors】:
KV Backoff Duration:KV 每个请求重试的总时间。TiDB 向 TiKV 发送请求时可能遇到错误,TiDB 对每个向 TiKV 的请求都有重试机制,这里记录的是一个请求重试的总时间
TiClient Region Error OPS:TiKV 返回 Region 相关错误信息的数量
KV Backoff OPS:TiKV 返回错误信息的数量
Lock Resolve OPS:TiDB 清理锁操作的数量。当 TiDB 的读写请求遇到锁时,会尝试进行锁清理
【TiKV Summary監控面板 - Errors】:
Raftstore error:每个 TiKV 实例上 raftstore 发生错误的个数
Scheduler error:每个 TiKV 实例上 scheduler 发生错误的个数
Coprocessor error:每个 TiKV 实例上 coprocessor 发生错误的个数