0

我正在更新一个表,我似乎有一个锁,它不会释放。如果我没看错,事务 2 已回滚,但事务 1 仍在锁定我的表。有没有办法强制终止事务并将其回滚?

*** (1) TRANSACTION:
TRANSACTION 421886199343912, ACTIVE 5 sec fetching rows
mysql tables in use 3, locked 3
LOCK WAIT 224788 lock struct(s), heap size 25419896, 2349612 row lock(s)
MySQL thread id 2967966, OS thread handle 140383641106176, query id 458710084 web.pub 192.168.2.57 user1 executing  
INSERT IGNORE into file_search select distinct f.id, f.basename,f.filename,f.filesize as   ...
 *** (1) HOLDS THE LOCK(S):
 RECORD LOCKS space id 2272 page no 2238466 n bits 456 index datatype_sensor_basename_idx of table `datastore`.`files` trx id 421886199343912 lock mode S waiting
 Record lock, heap no 215 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
 0: len 2; hex 8411; asc   ;;
 1: len 2; hex 8007; asc   ;;
 2: len 27; hex 41323032313331313231343030302e4c325f4c41435f4f432e6e63; asc   fill.pdf;;
 3: len 4; hex 0b103a5a; asc   :Z;;

 *** (1) WAITING FOR THIS LOCK TO BE GRANTED:
 RECORD LOCKS space id 2272 page no 2238466 n bits 456 index datatype_sensor_basename_idx  of table `datastore`.`files` trx id 421886199343912 lock mode S waiting
 Record lock, heap no 215 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
 0: len 2; hex 8411; asc   ;;
 1: len 2; hex 8007; asc   ;;
 2: len 27; hex 41323032313331313231343030302e4c325f4c41435f4f432e6e63; asc  file2.pdf;;
 3: len 4; hex 0b103a5a; asc   :Z;;

 *** (2) TRANSACTION:
 TRANSACTION 850180982, ACTIVE 33 sec updating or deleting
 mysql tables in use 1, locked 1
 LOCK WAIT 893 lock struct(s), heap size 123000, 16885 row lock(s), undo log entries 14091
 MySQL thread id 3045015, OS thread handle 140383648741120, query id 458721905   web.pub 192.168.2.187 user1 updating
 UPDATE files SET ... where id = 100
 *** (2) HOLDS THE LOCK(S):                                                                                                                                              RECORD LOCKS space id 2272 page no 2238466 n bits 456 index datatype_sensor_basename_idx of   table `datastore`.`files` trx id 850180982 lock_mode X locks rec but not gap
Record lock, heap no 215 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
0: len 2; hex 8411; asc   ;;
1: len 2; hex 8007; asc   ;;
2: len 27; hex 41323032313331313231343030302e4c325f4c41435f4f432e6e63; asc   file3.pdf;;
3: len 4; hex 0b103a5a; asc   :Z;;

*** (2) WAITING FOR THIS LOCK TO BE GRANTED:                                                                                                                           RECORD LOCKS space id 2272 page no 2238466 n bits 456 index datatype_sensor_basename_idx of   table `datastore`.`files` trx id 850180982 lock_mode X locks gap before rec insert intention   waiting
 Record lock, heap no 215 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
 0: len 2; hex 8411; asc   ;;
 1: len 2; hex 8007; asc   ;;
 2: len 27; hex 41323032313331313231343030302e4c325f4c41435f4f432e6e63; asc A2021311214000.L2_LAC_OC.nc;;
 3: len 4; hex 0b103a5a; asc   :Z;;
 *** WE ROLL BACK TRANSACTION (2)
4

0 回答 0