Three TiKV nodes encounter a large number of [error-response] [err="Key is locked (will clean up) primary_lock

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

Original topic: [3台tikv出现大量的[error-response] err="Key is locked (will clean up) primary_lock

| username: TiDBer_Y2d2kiJh

[TiDB Usage Environment] Production Environment
[TiDB Version] v5.4.0 2tidb 2pd 3tikv
[Reproduction Path] A large number of [error-response] [err="Key is locked (will clean up) primary_lock errors appear in 3tikv. How should this situation be handled?
[Encountered Problem: Problem Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Log/Monitoring]

| username: tidb菜鸟一只 | Original post link

Check the dashboard page to see if there are many corresponding table update statements.

| username: zhanggame1 | Original post link

I searched and found that someone encountered the same issue. Check if it’s the same problem:
https://blog.51cto.com/u_15550868/5576373

| username: TiDBer_Y2d2kiJh | Original post link

There are some update statements.

| username: tidb菜鸟一只 | Original post link

Is it an update to the primary key of a single row of data or something else?

| username: TiDBer_Y2d2kiJh | Original post link

There are many update statements, including single-row primary key updates.

| username: huhaifeng | Original post link

When writing, if the key is found to be locked, it will check whether the primary key is locked (note that this primary key is not related to the schema’s primary key, it is a randomly selected key); if the primary key is not locked, then the lock on the key can be obtained; if it is locked, then it can only wait;
This is content from the 302 course, you can check it out if you’re interested.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.