Note
This view is available starting with V4.0.0.
Purpose
The CDB_OB_DEADLOCK_EVENT_HISTORY view displays the history of deadlock events. This view shows the history of all tenants under the root tenant.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| EVENT_ID | bigint(20) unsigned | NO | The ID of the deadlock event. |
| SVR_IP | varchar(46) | NO | The IP address of the node involved in the deadlock event. |
| SVR_PORT | bigint(20) unsigned | NO | The port number of the node involved in the deadlock event. |
| DETECTOR_ID | bigint(20) unsigned | NO | The ID of the node involved in the deadlock event (unique within a process). |
| REPORT_TIME | timestamp(6) | NO | The time when the deadlock event was reported (based on the timestamp of the reporting server). |
| CYCLE_IDX | bigint(20) | NO | The index of the node in the cycle. |
| CYCLE_SIZE | bigint(20) | NO | The number of nodes involved in the deadlock event. |
| ROLE | longtext | NO | The role of the node in the deadlock event: |
| PRIORITY_LEVEL | longtext | NO | The priority level of the node: |
| PRIORITY | bigint(20) unsigned | NO | The priority value of the node. When priorities are the same, the priority value determines the node to be eliminated from the cycle, with the lowest priority value being eliminated. |
| CREATE_TIME | timestamp(6) | NO | The time when the node was created. |
| START_DELAY_US | bigint(20) unsigned | NO | The interval between the node's creation and the time it was allowed to start detecting deadlocks, in microseconds. |
| MODULE | longtext | NO | The module where the node is located. The value is fixed as transaction. |
| VISITOR | longtext | NO | The resource visitor represented by the node, in the format {session_id:$1}:{txid:$2}, where $1 and $2 are numbers. |
| OBJECT | longtext | NO | The resource that the node wants to acquire. The format is {addr:"$1:$2"}:{ls:$3}:{tablet:$4}:{row_key:{$5}}, where
|
| EXTRA_NAME1 | longtext | YES | The name of the additional information 1 that the upper layer wants to add to the deadlock report event. The format is wait_sql. |
| EXTRA_VALUE1 | longtext | YES | The SQL statement currently being executed when the transaction encountered a deadlock. |
| EXTRA_NAME2 | longtext | YES | The name of the additional information 2 that the upper layer wants to add to the deadlock report event. The format is hold_sql_request_time. |
| EXTRA_VALUE2 | longtext | YES | The request time of the statement that holds the lock. |
| EXTRA_NAME3 | longtext | YES | The name of the additional information 3 that the upper layer wants to add to the deadlock report event. The format is hold_sql. |
| EXTRA_VALUE3 | longtext | YES | The SQL statement corresponding to the cycle_idx - 1 row record's Object. |
Sample query
Query the history of deadlock events for all tenants.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_DEADLOCK_EVENT_HISTORY LIMIT 10;
