Overview
Scenarios
Product Architecture
Instance Types
Compatibility Notes
PERFORMANCE_SCHEMA.DATA_LOCK_WAITS is used to display all information about pessimistic lock waiting on the TDStore of all hybrid nodes in the cluster.DATA_LOCK_WAITS table, DATA_LOCK_WAITS will not incur additional overhead. Users do not need to set the performance_schema system variable to ON to query the DATA_LOCK_WAITS table.Field Name | Type | Description |
ENGINE | varchar(32) | Storage engine. For TDStore, the value is RocksDB. |
REQUESTING_ENGINE_LOCK_ID | varchar(128) | Indicates the pessimistic lock that is being applied for by the locked transaction uniquely identified as being blocked or the key range that is being read. For TDStore, its format is <ID of the transaction holding the lock>_<lock scope>. The format of <lock scope> is:If the lock scope is a single key, <lock scope> is the hexadecimal representation of the key. For example: The lock identifier 28673778183569468_00002797 indicates that a transaction with ID 28673778183569468 has added a pessimistic lock to the key with hexadecimal code 00002797.If the lock scope is a key interval, the format of <lock scope> is [<hex_start_key>,<hex_end_key>) (left-closed and right-open) or (<hex_start_key>,<hex_end_key>) (open interval). For example: The lock identifier 28673778183569468_[00002797,00002798) indicates that the transaction with ID 28673778183569468 has added a pessimistic lock to the interval [00002797,00002798).When the hexadecimal representation of a key is too long and cannot be fully represented within 128 characters, the last two characters of the field value will be set to .., indicating that this is not a complete lock identifier. In such cases, when users query information about pessimistic locks via ENGINE_LOCK_ID, they must also use the field value containing .. to perform the query. |
REQUESTING_NODE_ID | bigint unsigned | Enabling the ID of the SQLEngine node of the blocked transaction. |
REQUESTING_NODE_NAME | varchar(64) | Enabling the name of the SQLEngine node of the blocked transaction. |
REQUESTING_ENGINE_TRANSACTION_ID | bigint unsigned | The unique identifier of the blocked transaction. For TDStore, if the blocked request is read-only, the value is 0. |
REQUESTING_THREAD_ID | bigint unsigned | The thread ID executing the blocked transaction. This is the thread ID internally maintained by Performance Schema, which can be used to correlate with various Performance Schema event tables. |
REQUESTING_EVENT_ID | bigint unsigned | Indicates the event ID of the Performance Schema causing the lock acquisition by the blocked transaction. For TDStore, the value is NULL. |
REQUESTING_OBJECT_INSTANCE_BEGIN | bigint unsigned | Indicates the address of the lock request in memory. |
BLOCKING_ENGINE_LOCK_ID | varchar(128) | The unique identifier of the pessimistic lock. For TDStore, the format refers to the ENGINE_LOCK_ID field in the data_locks table. |
BLOCKING_NODE_ID | bigint unsigned | Enabling the ID of the SQLEngine node of the transaction holding the pessimistic lock. |
BLOCKING_NODE_NAME | varchar(64) | Displaying the name of the SQLEngine node of the transaction holding the pessimistic lock. |
BLOCKING_ENGINE_TRANSACTION_ID | bigint unsigned | Indicates the unique identifier of the transaction holding the pessimistic lock. If the pessimistic lock is a read lock held by multiple transactions, only the unique identifier of one transaction will be displayed. |
BLOCKING_THREAD_ID | bigint unsigned | The thread ID executing the transaction holding the pessimistic lock. This is the thread ID internally maintained by Performance Schema, which can be used to correlate with various event tables of Performance Schema. |
BLOCKING_EVENT_ID | bigint unsigned | Indicates the ID of the Performance Schema event that caused the transaction holding the pessimistic lock to be locked. For TDStore, the value is NULL. |
BLOCKING_OBJECT_INSTANCE_BEGIN | bigint unsigned | Indicates the address of the pessimistic lock in memory. |
TINDEX_ID | int unsigned | Indicates the tindex ID corresponding to the pessimistic lock. By using the value of this field, you can execute SELECT * FROM information_schema.statistics WHERE tindex_id=... to retrieve table information associated with the tindex ID from the system tables. |
DATA_SPACE_TYPE | varchar(32) | Indicates data space corresponding to the pessimistic lock. DATA_SPACE_TYPE_USER represents locking part of the data in user tables. DATA_SPACE_TYPE_SYSTEM represents locking part of the data in system tables. |
REPLICATION_GROUP_ID | bigint unsigned | Indicates the replication group ID corresponding to the pessimistic lock. |
KEY_RANGE_REGION_ID | bigint unsigned | Indicates the region ID of the key range corresponding to the pessimistic lock. |
tdsql [(none)]> SELECT * FROM performance_schema.data_lock_waits \\G*************************** 1. row ***************************ENGINE: RocksDBREQUESTING_ENGINE_LOCK_ID: 28681541555060779_[00002797,00002798)REQUESTING_NODE_ID: 2REQUESTING_NODE_NAME: node-1-002REQUESTING_ENGINE_TRANSACTION_ID: 28681541555060779REQUESTING_THREAD_ID: 44REQUESTING_EVENT_ID: 0REQUESTING_OBJECT_INSTANCE_BEGIN: 139759771095568BLOCKING_ENGINE_LOCK_ID: 28681535313936395_0000279780000001BLOCKING_NODE_ID: 1BLOCKING_NODE_NAME: node-1-001BLOCKING_ENGINE_TRANSACTION_ID: 28681535313936395BLOCKING_THREAD_ID: 44BLOCKING_EVENT_ID: 0BLOCKING_OBJECT_INSTANCE_BEGIN: 139759768476120TINDEX_ID: 10135DATA_SPACE_TYPE: DATA_SPACE_TYPE_USERREPLICATION_GROUP_ID: 257KEY_RANGE_REGION_ID: 7312
-- Query the number of requests waiting for pessimistic locks on all nodes.SELECT COUNT(*) FROM performance_schema.data_lock_wais \\G-- Query all information on waiting for pessimistic locks for key range region 7312 in replication group 257 across all nodes (Querying by key_range_region_id alone is possible but less efficient, as it cannot leverage index acceleration).SELECT * FROM performance_schema.data_lock_waits WHERE replication_group_id = 257 AND key_range_region_id = 7312 \\G-- Query information about the pessimistic lock that transaction 28682479434989637 is waiting for on all nodes.SELECT blocking_engine_lock_id FROM performance_schema.data_lock_waits WHERE requesting_engine_transaction_id = 28682479434989637;-- Specify engine_lock_id as the value of the blocking_engine_lock_id field obtained from the first sql query.SELECT * FROM performance_schema.data_locks WHERE engine_lock_id = '29417475275751454_00002C7B80000003';
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan