Experts, which log can be used to view transaction-related logs or identify any SQL queries with uncommitted transactions?

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

Original topic: 大佬们,哪个日志可以看到事务相关日志或有什么sql查询未提交的事务

| username: 点点-求助来了

[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.

| username: 啦啦啦啦啦 | Original post link

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.

| username: 裤衩儿飞上天 | Original post link

show processlist

| username: 点点-求助来了 | Original post link

Alright! Are there any other ways to check? Thanks.

| username: 裤衩儿飞上天 | Original post link

select * from INFORMATION_SCHEMA.CLUSTER_PROCESSLIST;
| username: 啦啦啦啦啦 | Original post link

In the processlist, the field state is “in transaction”.

| username: 点点-求助来了 | Original post link

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.

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

If you can see the count from “select count(1) from table_name”, it means it has been committed.

| username: DBRE | Original post link

Each tidb-server executes: set tidb_general_log=1; then check the tidb.log of each tidb-server.

| username: 点点-求助来了 | Original post link

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.

| username: 裤衩儿飞上天 | Original post link

I don’t quite understand where this delay in your database table is coming from.

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

I don’t understand, can you take a screenshot?