Updated on 2026-08-25 GMT+08:00

Obtaining All Deadlocks

Function

This API is used to obtain all deadlocks.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the permission listed below is required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    das::showCloudDBAInfo

    read

    -

    -

    -

    -

URI

GET /v3/{project_id}/instances/{instance_id}/get-full-dead-lock-list

Table 1 URI parameters

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 allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Query parameters

Parameter

Mandatory

Type

Description

start_at

Yes

Long

Definition

Start timestamp (ms).

Constraints

N/A

Range

N/A

Default Value

N/A

end_at

Yes

Long

Definition

End timestamp (ms).

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

full_dead_lock_list

Array of objects in Table 4

Definition

List of all deadlocks.

Range

N/A

Table 4 full_dead_lock

Parameter

Type

Description

happen_time

Long

Definition

Occurrence time (ms).

Range

N/A

mysql_dead_lock

Table 5 object

Definition

Deadlock content.

Range

N/A

Table 5 MySQL_Dead_Lock

Parameter

Type

Description

raw

String

Definition

Original deadlock content.

Range

N/A

happen_time

Long

Definition

Occurrence time (ms).

Range

N/A

rollback_trx_id

String

Definition

Rollback transaction ID.

Range

N/A

mysql_transactions

Array of objects in Table 6

Definition

Transaction list.

Range

N/A

Table 6 MySQL_Transaction

Parameter

Type

Description

session_id

String

Definition

Session ID.

Range

N/A

thread_id

String

Definition

Thread ID.

Range

N/A

request_type

String

Definition

Request type.

Range

N/A

transaction_id

String

Definition

Transaction ID.

Range

N/A

table

String

Definition

Involved table.

Range

N/A

waiting_lock

String

Definition

Lock being waited for.

Range

N/A

waiting_lock_index

String

Definition

Index name of the lock being waited for.

Range

N/A

waiting_lock_type

String

Definition

Index type of the lock being waited for.

Range

N/A

holding_lock

String

Definition

Held lock.

Range

N/A

holding_lock_index

String

Definition

Held lock index.

Range

N/A

holding_lock_type

String

Definition

Held lock index type.

Range

N/A

sql

String

Definition

SQL statement.

Range

N/A

Example Requests

GET https://das.cn-north-1.myhuaweicloud.com/v3/052041494800d57c2f02c00275b4c247/connections/f6ec61f9-24c5-4aaf-b42b-d45d23274031/instances/query-latest-dead-lock-snapshot?id=1148
 

Example Responses

Status code: 200

Success.

{
    "mysql_dead_lock": {
        "raw": "2025-11-26 11:23:35 0x7ff39ff7b700\n*** TRANSACTION:\nTRANSACTION 87070095, ACTIVE 10 sec inserting\nmysql tables in use 1, locked 1\n3 lock struct(s), heap size 1136, 2 row lock(s), undo log entries 2\nMySQL thread id 28922284, OS thread handle 140684337592064, query id 160548617 100.79.0.247 root update\ninsert into shopping(b,c) values(1,6)\n*** HOLDS THE LOCK:\nRECORD LOCKS space id 44290 page no 4 n bits 72 index u_k of table `cds`.`shopping` trx id 87070095 lock_mode X locks rec but not gap\nRecord lock, heap no 5 PHYSICAL RECORD: n_fields 3; compact format; info bits 0\n 0: len 4; hex 80000001; asc     ;;\n 1: len 4; hex 80000008; asc     ;;\n 2: len 4; hex 80000004; asc     ;;\n\n***  WAITING FOR THIS LOCK TO BE GRANTED, WHICH CONFLICTS WITH THE LOCK HELD BY TRANSACTION 87070096:\nRECORD LOCKS space id 44290 page no 4 n bits 72 index u_k of table `cds`.`shopping` trx id 87070095 lock_mode X locks gap before rec insert intention waiting\nRecord lock, heap no 5 PHYSICAL RECORD: n_fields 3; compact format; info bits 0\n 0: len 4; hex 80000001; asc     ;;\n 1: len 4; hex 80000008; asc     ;;\n 2: len 4; hex 80000004; asc     ;;\n\n\n*** TRANSACTION:\nTRANSACTION 87070096, ACTIVE 5 sec inserting\nmysql tables in use 1, locked 1\nLOCK WAIT 2 lock struct(s), heap size 1136, 1 row lock(s), undo log entries 1\nMySQL thread id 28922355, OS thread handle 140682021132032, query id 160548542 100.79.0.247 root update\ninsert into shopping(b,c) values(1,8)\n*** HOLDS THE LOCK:\nRECORD LOCKS space id 44290 page no 4 n bits 72 index u_k of table `cds`.`shopping` trx id 87070096 lock mode S waiting\nRecord lock, heap no 5 PHYSICAL RECORD: n_fields 3; compact format; info bits 0\n 0: len 4; hex 80000001; asc     ;;\n 1: len 4; hex 80000008; asc     ;;\n 2: len 4; hex 80000004; asc     ;;\n\n***  WAITING FOR THIS LOCK TO BE GRANTED, WHICH CONFLICTS WITH THE LOCK HELD BY TRANSACTION 87070095:\nRECORD LOCKS space id 44290 page no 4 n bits 72 index u_k of table `cds`.`shopping` trx id 87070096 lock mode S waiting\nRecord lock, heap no 5 PHYSICAL RECORD: n_fields 3; compact format; info bits 0\n 0: len 4; hex 80000001; asc     ;;\n 1: len 4; hex 80000008; asc     ;;\n 2: len 4; hex 80000004; asc     ;;\n\n*** WE ROLL BACK TRANSACTION 87070096",
        "happen_time": 1764127415000,
        "time": "2025-11-26 11:23:35",
        "rollback_trx_id": "87070096",
        "mysql_transactions": [
            {
                "session_id": "160548617",
                "thread_id": "28922284",
                "request_type": "update",
                "transaction_id": "87070095",
                "table": "`cds`.`shopping`",
                "waiting_lock": "index u_k of table `cds`.`shopping` trx id 87070095 lock_mode X locks gap before rec insert intention waiting",
                "waiting_lock_index": "u_k",
                "waiting_lock_type": "X locks gap before rec insert intention waiting",
                "holding_lock": "index u_k of table `cds`.`shopping` trx id 87070095 lock_mode X locks rec but not gap",
                "holding_lock_index": "u_k",
                "holding_lock_type": "X locks rec but not gap",
                "sql": "insert into shopping(b,c) values(1,6)"
            },
            {
                "session_id": "160548542",
                "thread_id": "28922355",
                "request_type": "update",
                "transaction_id": "87070096",
                "table": "`cds`.`shopping`",
                "waiting_lock": "index u_k of table `cds`.`shopping` trx id 87070096 lock mode S waiting",
                "waiting_lock_index": "u_k",
                "waiting_lock_type": "S waiting",
                "holding_lock": "index u_k of table `cds`.`shopping` trx id 87070096 lock mode S waiting",
                "holding_lock_index": "u_k",
                "holding_lock_type": "S waiting",
                "sql": "insert into shopping(b,c) values(1,8)"
            }
        ]
    },
    "find_lock": true,
    "happen_time": 1764127415000
}

Status Codes

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Codes

See Error Codes.