How to Check Which Table is Locked When It Keeps Reporting Locks

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 一直报锁 怎么查是哪个表锁住了

| username: tidb狂热爱好者

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version]
[Encountered Issues]
[Reproduction Path] What operations were performed to encounter the issue
[Issue Phenomenon and Impact]
prewrite.rs:600] [“commit_ts is too large, fallback to normal 2PC”] [lock=“Lock { lock_type: Put, primary_key: 7480000000000028F55F6980000000000000010419AE3076660000000395FD153D69087000, start_ts: TimeStamp(436888237715488841), ttl: 3000, short_value: 8000040000000203040508001A0022002A004554432D55534454201080000000000000161AD2748000000000000000667630AE19000000857630AE19, for_update_ts: TimeStamp(0), txn_size: 1, min_commit_ts: TimeStamp(436888237715488842), use_async_commit: true, secondaries: , rollback_ts: }”] [max_commit_ts=436888238239776841] [min_commit_ts=436888239904391181] [start_ts=436888237715488841] [key=7480000000000028FFF55F7295FD153D69FF0870000000000000FA]

2022-10-24 15:26:15 (GMT+8) TiKV 172.31.177.79:20160 [endpoint.rs:621] [error-response] [err=“Key is locked (will clean up) primary_lock: 748000000000001F175F69800000000000000103800000003C2D3528038000000000031192 lock_version: 436888227006906385 key: 748000000000001F175F69800000000000000103800000003C2D3528038000000000031192 lock_ttl: 70000 txn_size: 12 lock_for_update_ts: 436888230807994456 use_async_commit: true min_commit_ts: 436888235067834489 secondaries: 748000000000001F175F69800000000000000103800000003C2D352803800000000003157A secondaries: 748000000000001F175F69800000000000000103800000003C2D35280380000000001EAFB7 secondaries: 748000000000001F175F69800000000000000103800000003C2D35280380000000001ED6C7 secondaries: 748000000000001F175F6980000000000000030419AE3075D80000000380000000490B40F6 secondaries: 748000000000001F175F6980000000000000030419AE3075D80000000380000000490B40F8 secondaries: 748000000000001F175F6980000000000000030419AE30765B0000000380000000490B40F7 secondaries: 748000000000001F175F6980000000000000030419AE30765B0000000380000000490B40F9 secondaries: 748000000000001F175F6980000000000000030419AE3076680000000380000000490B40F6 secondaries: 748000000000001F175F6980000000000000030419AE3076680000000380000000490B40F7 secondaries: 748000000000001F175F6980000000000000030419AE3076680000000380000000490B40F8 secondaries: 748000000000001F175F6980000000000000030419AE3076680000000380000000490B40F9 secondaries: 748000000000001F175F7280000000490B40F6 secondaries: 748000000000001F175F7280000000490B40F7 secondaries: 748000000000001F175F7280000000490B40F8 secondaries: 748000000000001F175F7280000000490B40F9 secondaries: 74800000000000221C5F69800000000000000103800000003C2D35280395FD153EE9D91000 secondaries: 74800000000000221C5F69800000000000000103800000003C2D35280395FD1549B4D91000 secondaries: 74800000000000221C5F6980000000000000020395FD153EE15910000395FD153EE9D91000 secondaries: 74800000000000221C5F6980000000000000020395FD153EE15910000395FD1549B4D91000 secondaries: 74800000000000221C5F7295FD153EE9D91000 secondaries: 74800000000000221C5F7295FD1549B4D91000 secondaries: 7480000000000023495F69800000000000000103800000003C2D35280380000000001ED6C70395FD153EE1591000 secondaries: 7480000000000023495F6980000000000000020419AE3076680000000395FD153EE1591000 secondaries: 7480000000000023495F69800000000000000303800000003C2D3528016372656174655F6FFF7264657200000000FB0395FD153EE1591000 secondaries: 7480000000000023495F69800000000000000403800000003C2D352803800000003C2D3528016372656174655F6FFF7264657200000000FB0380000000001EAFB70380000000001ED6C70395FD153EE1591000 secondaries: 7480000000000023495F69800000000000000503800000003C2D35280380000000001EAFB70380000000001ED6C70395FD153EE1591000 secondaries: 7480000000000023495F69800000000000000603800000003C2D3528016372656174655F6FFF7264657200000000FB0380000000001EAFB70380000000001ED6C70395FD153EE1591000 secondaries: 7480000000000023495F698000000000000007016372656174655F6FFF7264657200000000FB0419AE3076680000000395FD153EE1591000 secondaries: 7480000000000023495F698000000000000008016372656174655F6FFF7264657200000000FB0395FD153EE1591000 secondaries: 7480000000000023495F698000000000000009016372656174655F6FFF7264657200000000FB03800000003C2D352803800000003C2D35280395FD153EE1591000 secondaries: 7480000000000023495F7295FD153EE1591000 secondaries: 7480000000000030365F69800000000000000104000000003C2D35280395FD1530A9191000 secondaries: 7480000000000030365F6980000000000000020419AE3076670000000395FD1530A9191000 secondaries: 7480000000000030365F6980000000000000030419AE3076590000000400000000000000010395FD1530A9191000 secondaries: 7480000000000030365F6980000000000000040400000000000000010395FD1530A9191000 secondaries: 7480000000000030365F6980000000000000050419AE3076590000000395FD1530A9191000 secondaries: 7480000000000030365F6980000000000000060400000000000000010400000000000000020400000000000000010395FD1530A9191000 secondaries: 7480000000000030365F69800000000000000704000000003C2D35280400000000000000010395FD1530A9191000 secondaries: 7480000000000030365F7295FD1530A9191000 secondaries: 7480000000000031995F6980000000000000010395FD153EDF99100004000000000000000A secondaries: 7480000000000031995F6980000000000000020395FD1530A9191000010E4A0EFB0E4A101FFF0FEA0E6D10020000FD04000000000000000A secondaries: 7480000000000031995F6980000000000000040400000000000000010380000000001C0120 secondaries: 7480000000000031995F69800000000000000504000000003C2D35280380000000001C0120 secondaries: 7480000000000031995F69800000000000000604000000000000000104000000003C2D35280380000000001C0120 secondaries: 7480000000000031995F7280000000001C0120”]

[Attachments]

Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.

| username: h5n1 | Original post link

select tidb_decode_key(‘7480000000000028F55F6980000000000000010419AE3076660000000395FD153D69087000’); to get table_id

| username: tidb狂热爱好者 | Original post link

Self Q&A
MySQL [information_schema]> select * from tables where TIDB_TABLE_ID=10485; After querying,
use the tableid to find the specific table name and then hand it over to the developers to resolve.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.