tencent cloud

TDSQL Boundless

TDSTORE_PESSIMISTIC_DEADLOCK_DETAIL_INFO

PDF
Focus Mode
Font Size
Last updated: 2026-02-10 11:06:32

Function

On the node performing deadlock detection, by querying the TDSTORE_PESSIMISTIC_DEADLOCK_DETAIL_INFO system table, you can obtain the detailed waiting relationships of transactions forming deadlock rings in all historical deadlocks: including the transaction IDs applying for locks and blocking, the lock ranges being applied for and blocked, the node on which the SQL causing this waiting relationship is running, and the SQL statement being executed by the transaction causing this waiting relationship.

Field Description

Field Name
Type
Description
rollback_trans_id
bigint unsigned
The ID of the transaction rolled back in this deadlock ring.
requesting_node
varchar(64)
The SQLEngine node name executing the transaction requesting the pessimistic lock in the wait relationship of the lock.
requesting_trans_id
bigint unsigned
The transaction ID requesting the pessimistic lock in the wait relationship of the lock.
blocking_trans_id
bigint unsigned
The transaction ID that already holds the pessimistic lock in the wait relationship of the lock.
req_lock_range
varchar(64)
The lock range requested by the transaction applying for the pessimistic lock in the wait relationship of the lock.
blk_lock_range
varchar(64)
The lock range currently held by the transaction that already holds the pessimistic lock in the wait relationship of the lock.
timestamp
varchar(64)
The occurrence time of the deadlock event corresponding to this deadlock ring.
requesting_sql
varchar(128)
The SQL statement currently being executed by the transaction requesting the pessimistic lock in the wait relationship of the lock.

Examples

Output example:
tdsql> SELECT * FROM information_schema.tdstore_pessimistic_deadlock_detail_info \\G
*************************** 1. row ***************************
rollback_trans_id: 29468596191101374
requesting_node: node-1
requesting_trans_id: 29468595838780035
blocking_trans_id: 29468595939442912
req_lock_range: 000027308000000F
blk_lock_range: 000027308000000F
timestamp: 2025-08-29 19:00:30 82
requesting_sql: SELECT * FROM deadlock_test WHERE id = 15 FOR UPDATE
*************************** 2. row ***************************
rollback_trans_id: 29468596191101374
requesting_node: node-2
requesting_trans_id: 29468595939442912
blocking_trans_id: 29468596191101374
req_lock_range: [0000273080000010,0000273080000015)
blk_lock_range: [0000273080000010,0000273080000015)
timestamp: 2025-08-29 19:00:30 82
requesting_sql: SELECT * FROM deadlock_test WHERE id BETWEEN 16 AND 20 FOR UPDATE
*************************** 3. row ***************************
rollback_trans_id: 29468596191101374
requesting_node: node-3
requesting_trans_id: 29468596191101374
blocking_trans_id: 29468595838780035
req_lock_range: 000027308000000C
blk_lock_range: [000027308000000A,000027308000000F)
timestamp: 2025-08-29 19:00:30 82
requesting_sql: SELECT * FROM deadlock_test WHERE id = 12 FOR UPDATE
Query Example
-- Query detailed information on historical deadlocks on all nodes
SELECT * FROM information_schema.tdstore_pessimistic_deadlock_detail_info \\G

-- Query detailed information about the deadlock event where the transaction with ID 29468596191101374 was rolled back on all nodes:
SELECT * FROM information_schema.tdstore_pessimistic_deadlock_detail_info WHERE rollback_trans_id = 29468596191101374 \\G

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback