During the operation of OceanBase Database, transaction requests sent by the client are executed, and the results are returned to the client. If the transaction execution fails or an exception occurs, a transaction error will be generated. Common transaction errors are generally divided into two categories. One category is errors thrown to the client during transaction execution, and the other category is errors discovered through system logs or internal views. This topic summarizes these two categories of errors and summarizes common troubleshooting methods to help you identify common issues.
Troubleshooting methods
For transaction issues, the main troubleshooting methods include querying the transaction status table and retrieving system logs.
The GV$OB_TRANSACTION_PARTICIPANTS view records the context information of all uncompleted transaction participants in the entire cluster, including the leader and follower nodes. By collecting the information of all participants in the current transaction, you can construct the execution status of the entire transaction. Key fields:
TX_TYPE: During transaction execution, this field is displayed as UNDECIDED on the leader node. During transaction submission, this field displays the specific type of the transaction, such as LOCAL or DISTRIBUTED.STATE: Displays the status of the transaction execution. During transaction execution, this field is displayed as ACTIVE.ACTION: During transaction execution, this field is displayed as START on the leader node. During transaction submission, this field is displayed as COMMIT on the leader node.
For example, the following statement shows the information of an executing transaction.
obclient(root@sys)[oceanbase]> select * from gv$ob_transaction_participants\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1
SVR_IP: xx.xx.xx.xx
SVR_PORT: 2882
SESSION_ID: 3221637294
SCHEDULER_ADDR: "xx.xx.xx.xx:2882"
TX_TYPE: LOCAL
TX_ID: 4051827
LS_ID: 1
PARTICIPANTS: [{id:-1}]
CTX_CREATE_TIME: 2025-04-27 15:25:50.859591
TX_EXPIRED_TIME: 2025-04-27 15:26:20.859575
STATE: ACTIVE
ACTION: COMMIT
PENDING_LOG_SIZE: 0
FLUSHED_LOG_SIZE: 73
ROLE: LEADER
COORD: 1
LAST_REQUEST_TIME: 2025-04-27 15:25:50.859591
FORMATID: -1
GLOBALID: NULL
BRANCHID: NULL
1 row in set
For system logs, you can search for OBServer logs in the specified time period by using the trace ID to display all logs on the execution path of a statement. You can also search for all logs related to the transaction by using the trans ID.
