Querying InnoDB Lock Waits
Function
This API is used to query InnoDB lock waits.
Authorization Information
Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.
- If you are using role/policy-based authorization, see the required permissions in Permissions Policies and Supported Actions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
das:clouddba:listInnodbLock
list
Instance
-
-
-
URI
GET /v3/{project_id}/connections/{connection_id}/instance/query-waiting-locks
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID of a tenant in a region. To obtain the value, see Obtaining a Project ID. Constraints N/A Range The value can contain 32 characters. Only letters and digits are supported. Default Value N/A |
| connection_id | Yes | String | Definition Connection ID established between a database account and the database. The database user ID is created using the API in Creating an Instance Connection. Constraints N/A Range The value is a UUID containing 36 characters. Only letters, digits, and hyphens (-) are allowed. Default Value N/A |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| trx | Array of objects in Table 3 | Definition Information about the transaction corresponding to the InnoDB lock Range N/A |
| lock_waits_infos | Array of objects in Table 5 | Definition InnoDB lock wait information Range N/A |
| wait_lock_count | Integer | Definition Number of sessions waiting for locks Range N/A |
| hold_lock_count | Integer | Definition Number of sessions holding locks Range N/A |
| time_greater_than_count | Integer | Definition Number of sessions whose lock wait time is greater than the threshold Range N/A |
| lock_wait_threshold_second | Long | Definition InnoDB lock wait time threshold Range N/A |
| Parameter | Type | Description |
|---|---|---|
| trx_id | String | Definition Transaction ID Range N/A |
| trx_state | String | Definition Transaction status Range
|
| trx_started | String | Definition Transaction start time Range N/A |
| trx_started_timestamp | Long | Definition Transaction start timestamp Range N/A |
| trx_requested_lock_id | String | Definition ID of the lock that the transaction is waiting for Range N/A |
| trx_wait_started | String | Definition Time when the transaction starts to wait Range N/A |
| trx_wait_started_timestamp | Long | Definition Timestamp when the transaction starts to wait Range N/A |
| trx_weight | String | Definition Transaction weight Range N/A |
| trx_mysql_thread_id | String | Definition Session ID Range N/A |
| trx_query | String | Definition SQL statement that is being executed by the transaction Range N/A |
| trx_operation_state | String | Definition Current operation status of a transaction Range N/A |
| trx_tables_in_use | String | Definition Number of tables used in the SQL statement executed by the current transaction Range N/A |
| trx_tables_locked | String | Definition Number of row locks of the SQL statement that is being executed Range N/A |
| trx_lock_structs | String | Definition Number of locks retained by a transaction Range N/A |
| trx_lock_memory_bytes | String | Definition Size of the memory locked by a transaction Range N/A |
| trx_rows_locked | String | Definition Number of rows locked by a transaction Range N/A |
| trx_rows_modified | String | Definition Number of rows modified by a transaction Range N/A |
| trx_concurrency_tickets | String | Definition Number of concurrent transaction votes Range N/A |
| trx_isolation_level | String | Definition Isolation level of the current transaction Range N/A |
| trx_unique_checks | String | Definition Whether to enable the uniqueness check Range N/A |
| trx_foreign_key_checks | String | Definition Whether to enable the foreign key check Range N/A |
| trx_last_foreign_key_error | String | Definition Last foreign key error information Range N/A |
| trx_adaptive_hash_latched | String | Definition Whether the adaptive hash index is locked by the current transaction Range N/A |
| trx_adaptive_hash_timeout | String | Definition Whether to immediately give up searching for LATCH for the adaptive hash index Range N/A |
| wait_locks | Array of objects in Table 4 | Definition List of wait locks Range N/A |
| hold_locks | Array of objects in Table 4 | Definition List of held locks Range N/A |
| Parameter | Type | Description |
|---|---|---|
| lock_id | String | Definition Lock ID Range N/A |
| lock_trx_id | String | Definition ID of the transaction that holds the lock Range N/A |
| lock_mode | String | Definition Lock mode Range N/A |
| lock_type | String | Definition Lock type Range N/A |
| lock_table | String | Definition Locked table Range N/A |
| lock_index | String | Definition Locked index Range N/A |
| lock_space | String | Definition ID of the tablespace where the locked row is located Range N/A |
| lock_page | String | Definition Locked page Range N/A |
| lock_rec | String | Definition Number of locked rows Range N/A |
| lock_data | String | Definition Primary key of a locked row Range N/A |
| Parameter | Type | Description |
|---|---|---|
| requesting_trx_id | String | Definition ID of a request transaction Range N/A |
| requested_lock_id | String | Definition ID of a lock to be waited for Range N/A |
| blocking_trx_id | String | Definition ID of a blocked transaction Range N/A |
| blocking_lock_id | String | Definition ID of a held lock Range N/A |
Example Requests
GET https://das.cn-north-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/connections/179e525e-0e9c-4dcc-9dd7-ee2f36121e23/instance/query-waiting-locks
Example Responses
Status code: 200
Success.
{
"trx": [],
"lock_waits_infos": [],
"wait_lock_count": 0,
"hold_lock_count": 0,
"time_greater_than_count": 0,
"lock_wait_threshold_second": 10
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Success. |
| 400 | Client error. |
| 500 | Server error. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot