TiKV Node Error: Region error (will back off and retry) and Key is locked (will clean up)

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

Original topic: TIKV节点报错Region error (will back off and retry)和Key is locked (will clean up)

| username: TiDBer_70iA97nn

[TiDB Usage Environment] Production Environment
[TiDB Version] V7.5.0
[Reproduction Path] No operations performed
[Encountered Problem: Phenomenon and Impact] The cluster deployment mode is 2DB, 3KV, 3PD mode. Occasionally, the 3KV component reports the following errors:
Error WARN 1:

Error WARN 2:

[Attachments: Screenshots/Logs/Monitoring]

| username: TiDBer_70iA97nn | Original post link

Can the experts take a look and see if these two warning messages have any impact?

| username: 大飞哥online | Original post link

Region error (will back off and retry):
This error usually indicates that TiKV encountered some errors while processing the Region, leading to the need for a retry. Possible reasons include network failures, Region data corruption, or other TiKV node failures. In such cases, TiKV will attempt to retry to restore normal operations.

| username: 大飞哥online | Original post link

This error indicates a read-write conflict, meaning a locked key was encountered during data reading. This could be due to an uncommitted optimistic lock or an uncommitted transaction. To handle this situation, you can filter out the most frequently occurring primary_lock to locate the issue. You can use a command similar to the following to filter and view the most frequently occurring primary_lock:

cat tikv.log | grep error-response | awk -F "primary_lock:" '{print $2}' | awk -F " " '{print $1}' | sort | uniq -c | sort -n