Help Center/ Data Admin Service/ API Reference/ APIs/ Intelligent O&M/ Querying InnoDB Lock Wait Snapshots
Updated on 2026-08-25 GMT+08:00

Querying InnoDB Lock Wait Snapshots

Function

This API is used to query InnoDB lock wait snapshots.

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-snapshot

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain this 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

Table 2 Query parameters

Parameter

Mandatory

Type

Description

id

Yes

Integer

Definition

InnoDB lock wait snapshot ID

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

trx

Array of Table 3 objects

Definition

Information about the transaction corresponding to the InnoDB lock

Range

N/A

lock_waits_infos

Array of Table 5 objects

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

Table 4 InnodbTrxInfo

Parameter

Type

Description

trx_id

String

Definition

Transaction ID

Range

N/A

trx_state

String

Definition

Transaction status

Range

  • RUNNING
  • LOCK WAIT
  • ROLLING BACK
  • COMMITTING

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 Table 4 Object

Definition

List of wait locks

Range

N/A

hold_locks

Array of Table 4 Object

Definition

List of held locks

Range

N/A

Table 5 InnodbLockInfo

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

Table 6 InnodbLockWaitsInfo

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-snapshot?id=1

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.