Note
This view was introduced in OceanBase Database V4.0.0.
Purpose
The oceanbase.CDB_OB_DEADLOCK_EVENT_HISTORY view displays the history of deadlock events. After you log in as the root user to the sys tenant, you can view the deadlock event history of all tenants.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| EVENT_ID | bigint(20) unsigned | NO | The ID of the deadlock event. |
| SVR_IP | varchar(46) | NO | The IP address of the node participating in the deadlock event. |
| SVR_PORT | bigint(20) unsigned | NO | The port number of the node participating in the deadlock event. |
| DETECTOR_ID | bigint(20) unsigned | NO | The ID of the node participating in the deadlock event, which is unique within the process. |
| REPORT_TIME | timestamp(6) | NO | The reporting time of the deadlock event based on the timestamp on the reporting server. |
| CYCLE_IDX | bigint(20) | NO | The serial number of the node in the deadlock cycle. |
| CYCLE_SIZE | bigint(20) | NO | The number of nodes participating in the deadlock event. |
| ROLE | longtext | NO | The role that the node plays in the deadlock event. Valid values:witnessvictim |
| PRIORITY_LEVEL | longtext | NO | The level of priority of the node. Valid values:extreme-lowlownormalhighextreme-high |
| PRIORITY | bigint(20) unsigned | NO | The priority value that the node has. When the priorities of different nodes are the same, the priority values are checked, and the node with the lowest priority value in the cycle is evicted. |
| CREATE_TIME | timestamp(6) | NO | The time when the node was created. |
| START_DELAY_US | bigint(20) unsigned | NO | The interval in microseconds between the node creation time and the time when deadlock detection starts. |
| MODULE | longtext | NO | The module where the node resides. The value is transaction. |
| VISITOR | longtext | NO | The resource visitor represented by the node. The value is in the {session_id:$1}:{txid:$2} format. $1 and $2 are numbers.
NoteThe value of this column is in the |
| OBJECT | longtext | NO | The resource that the node requests for. The primary key of the row is in the {addr:"$1:$2"}:{ls:$3}:{tablet:$4}:{row_key:{$5}} format.
NoteThe value of this column is in the |
| EXTRA_NAME1 | longtext | YES | The name of additional information 1 that the upper layer wishes to add to the deadlock report event. The value is in the wait_sql format.
NoteThe value of this column is in the |
| EXTRA_VALUE1 | longtext | YES | The SQL statement being executed when the deadlock occurred in the transaction. |
| EXTRA_NAME2 | longtext | YES | The name of additional information 2 that the upper layer wishes to add to the deadlock report event. The value is in the hold_sql_request_time format.
NoteThe value of this column is empty in OceanBase Database of versions earlier than V4.2.5. |
| EXTRA_VALUE2 | longtext | YES | The request time of the lock hold statement.
NoteThe value of this column is empty in OceanBase Database of versions earlier than V4.2.5. |
| EXTRA_NAME3 | longtext | YES | The name of additional information 3 that the upper layer wishes to add to the deadlock report event. The value is in the hold_sql format.
NoteThe value of this column is empty in OceanBase Database of versions earlier than V4.2.5. |
| EXTRA_VALUE3 | longtext | YES | The SQL statement that holds the object corresponding to the row record numbered cycle_idx - 1.
NoteThe value of this column is empty in OceanBase Database of versions earlier than V4.2.5. |
Sample query
Query the history of deadlock events in all tenants.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_DEADLOCK_EVENT_HISTORY LIMIT 10;