Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 锁等待查看
【TiDB Usage Environment】Production Environment or Test Environment or POC
【TiDB Version】
【Encountered Issue】
For a v4.0 cluster, besides checking the log files for lock wait information, is there a system table where this information can be viewed?
【Reproduction Path】What operations were performed that led to the issue
【Issue Phenomenon and Impact】
【Attachments】
Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.
There should be no related system tables, but higher versions have them.
In version 4.0, the cluster_slow_log
and statement_summary_history
views under information_schema
record the lock wait duration of related SQL. Starting from version 5.1, a lock view has been added.
Yes, there is the INFORMATION_SCHEMA.DATA_LOCK_WAITS table.
There is, the INFORMATION_SCHEMA.DATA_LOCK_WAITS table
This table is real-time, the lock disappears once it is resolved. Is there a table that records historical locks?
There is no historical lock information table, which is the same as MySQL. You can create your own monitoring for this. Insert the data from the processlist and data_lock_waits tables into a historical table every minute, and keep the data for the last month in the historical table.
Okay, thank you, teacher. I have implemented this feature myself.
You’re referring to a higher version.
Does the table in version 6.1 still record lock conflicts in the statement summary history?
This topic was automatically closed 1 minute after the last reply. No new replies are allowed.