查询单个死锁详情。
接口说明
本接口用于获取最近死锁分析、全量死锁分析的单个死锁详情。详情请参见死锁分析。
使用该接口需满足以下前提条件:
查询最近死锁分析详情的目标数据库引擎为:RDS MySQL、自建 MySQL、PolarDB MySQL 版、PolarDB-X 2.0。
查询全量死锁分析详情的目标数据库引擎为:RDS MySQL、PolarDB MySQL 版,且已开通DAS 运维服务(原经济版)。
使用阿里云或 DAS 的 SDK 时,建议使用最新版本。
使用 SDK 调用 DAS 服务时,需要将地域指定为 cn-shanghai。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
hdm:GetDeadLockDetail |
none |
*全部资源
|
无 | 无 |
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
InstanceId |
string |
是 |
实例 ID。 |
pc-bp1u5mas9exx7**** |
NodeId |
string |
否 |
节点 ID。 说明
对于 PolarDB MySQL 版实例,需要提供节点 ID。 |
pi-bp16v3824rt73**** |
TextId |
string |
是 |
查询死锁历史任务列表 GetDeadLockHistory 中返回的死锁 TextId。 |
a0e390cd5aca9ae964448f040153**** |
Source |
string |
否 |
任务来源:
|
AUTO |
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
|||
RequestId |
string |
请求 ID。 |
9CB97BC4-6479-55D0-B9D0-EA925AFE**** |
Message |
string |
请求返回消息。 说明
请求成功时该参数返回 Successful,请求失败时会返回请求异常信息(如错误码等)。 |
Successful |
Synchro |
string |
备用参数。 |
None |
Data |
string |
返回的 JSON 格式数据:
|
{ "accountId": "108************", "textId": "35303d12d52d29ba73bb************", "gmtModified": 1732712680000, "originText": "LATEST DETECTED DEADLOCK的原始死锁文本或错误日志中的原始死锁文本", "deadlock": "{\"id\":0,\"occurTime\":1732687047000,\"originTextId\":\"35303d12d52d29ba73bb************\",\"rollbackTrxId\":\"2\",\"transactions\":[{\"deadlockIdInDB\":0,\"ip\":\"100.***.***.***\",\"lockWait\":\"index PRIMARY of table `das`.`students` trx id 15989454 lock_mode X locks rec but not gap waiting\",\"queryId\":\"386737457\",\"queryType\":\"updating\",\"relatedTables\":[\"`das`.`students`\"],\"sqlText\":\"update students set name=UUID() where id = 2 \",\"tableNamesString\":\"`das`.`students`\",\"threadId\":\"9194526\",\"transactionId\":\"15989454\",\"trxIdInLock\":1,\"userName\":\"das\",\"waitLockIndexName\":\"PRIMARY \",\"waitLockMode\":\"X locks rec but not gap waiting\"},{\"deadlockIdInDB\":0,\"holdLockIndexName\":\"PRIMARY \",\"holdLockMode\":\"X locks rec but not gap\",\"ip\":\"100.***.***.***\",\"lockHold\":\"index PRIMARY of table `das`.`students` trx id 15989451 lock_mode X locks rec but not gap\",\"lockWait\":\"index PRIMARY of table `das`.`students` trx id 15989451 lock_mode X locks rec but not gap waiting\",\"queryId\":\"386737566\",\"queryType\":\"updating\",\"relatedTables\":[\"`das`.`students`\"],\"sqlText\":\"update students set name=UUID() where id = 3 \",\"tableNamesString\":\"`das`.`students`\",\"threadId\":\"9194501\",\"transactionId\":\"15989451\",\"trxIdInLock\":2,\"userName\":\"das\",\"waitLockIndexName\":\"PRIMARY \",\"waitLockMode\":\"X locks rec but not gap waiting\"}],\"trxNum\":2}", "gmtCreate": 1732712680000, "nodeId": "pi-8****************", "uuid": "pc-8v***************" } |
Code |
string |
返回的状态码。 |
200 |
Success |
string |
请求是否执行成功:
|
true |
示例
正常返回示例
JSON
格式
{
"RequestId": "9CB97BC4-6479-55D0-B9D0-EA925AFE****",
"Message": "Successful",
"Synchro": "None",
"Data": "{\n \"accountId\": \"108************\",\n \"textId\": \"35303d12d52d29ba73bb************\",\n \"gmtModified\": 1732712680000,\n \"originText\": \"LATEST DETECTED DEADLOCK的原始死锁文本或错误日志中的原始死锁文本\",\n \"deadlock\": \"{\\\"id\\\":0,\\\"occurTime\\\":1732687047000,\\\"originTextId\\\":\\\"35303d12d52d29ba73bb************\\\",\\\"rollbackTrxId\\\":\\\"2\\\",\\\"transactions\\\":[{\\\"deadlockIdInDB\\\":0,\\\"ip\\\":\\\"100.***.***.***\\\",\\\"lockWait\\\":\\\"index PRIMARY of table `das`.`students` trx id 15989454 lock_mode X locks rec but not gap waiting\\\",\\\"queryId\\\":\\\"386737457\\\",\\\"queryType\\\":\\\"updating\\\",\\\"relatedTables\\\":[\\\"`das`.`students`\\\"],\\\"sqlText\\\":\\\"update students set name=UUID() where id = 2 \\\",\\\"tableNamesString\\\":\\\"`das`.`students`\\\",\\\"threadId\\\":\\\"9194526\\\",\\\"transactionId\\\":\\\"15989454\\\",\\\"trxIdInLock\\\":1,\\\"userName\\\":\\\"das\\\",\\\"waitLockIndexName\\\":\\\"PRIMARY \\\",\\\"waitLockMode\\\":\\\"X locks rec but not gap waiting\\\"},{\\\"deadlockIdInDB\\\":0,\\\"holdLockIndexName\\\":\\\"PRIMARY \\\",\\\"holdLockMode\\\":\\\"X locks rec but not gap\\\",\\\"ip\\\":\\\"100.***.***.***\\\",\\\"lockHold\\\":\\\"index PRIMARY of table `das`.`students` trx id 15989451 lock_mode X locks rec but not gap\\\",\\\"lockWait\\\":\\\"index PRIMARY of table `das`.`students` trx id 15989451 lock_mode X locks rec but not gap waiting\\\",\\\"queryId\\\":\\\"386737566\\\",\\\"queryType\\\":\\\"updating\\\",\\\"relatedTables\\\":[\\\"`das`.`students`\\\"],\\\"sqlText\\\":\\\"update students set name=UUID() where id = 3 \\\",\\\"tableNamesString\\\":\\\"`das`.`students`\\\",\\\"threadId\\\":\\\"9194501\\\",\\\"transactionId\\\":\\\"15989451\\\",\\\"trxIdInLock\\\":2,\\\"userName\\\":\\\"das\\\",\\\"waitLockIndexName\\\":\\\"PRIMARY \\\",\\\"waitLockMode\\\":\\\"X locks rec but not gap waiting\\\"}],\\\"trxNum\\\":2}\",\n \"gmtCreate\": 1732712680000,\n \"nodeId\": \"pi-8****************\",\n \"uuid\": \"pc-8v***************\"\n}",
"Code": "200",
"Success": "true"
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 | InvalidParams | The request parameters are invalid. | 请求参数错误 |
403 | NoPermission | You are not authorized to do this action. | 没有权限执行该操作 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。