Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 大佬们,哪个日志可以看到事务相关日志或有什么sql查询未提交的事务
[TiDB Usage Environment] Production Environment
[TiDB Version] 5.0.1
[Reproduction Path] What operations were performed when the problem occurred
[Encountered Problem: Problem Phenomenon and Impact]
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]
Experts, which log can show transaction-related logs or any SQL queries with uncommitted transactions, TIDB_TRX does not exist.
TIDB_TRX was introduced as an experimental feature in version 5.1 and became generally available in 5.2. It is not available in 5.0.
Alright! Are there any other ways to check? Thanks.
select * from INFORMATION_SCHEMA.CLUSTER_PROCESSLIST;
In the processlist, the field state is “in transaction”.
The status found is all autocommit, but there is a table in the database with a significant data delay. The current inserted data can be counted using “select count(1) from table_name” to find the quantity, but the actual data increase cannot be seen.
If you can see the count from “select count(1) from table_name”, it means it has been committed.
Each tidb-server executes: set tidb_general_log=1; then check the tidb.log of each tidb-server.
But using select * from table_name, I can’t retrieve any results. There’s no solution, and I’ve been puzzled for a long time.
I don’t quite understand where this delay in your database table is coming from.
I don’t understand, can you take a screenshot?