mysql死锁日志解析下 1 TRANSACTIONTRANSACTION 10024296578 ACTIVE 0 sec fetching rowsmysql tables in use 1 locked 1LOCK WAIT 6 lock structs heap size 1136 4 row locksMySQL thread id 4014781 OS thread handle 1
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 5795 page no 316314 n bits 80 index PRIMARY of table itoc-wms-prod.shipment_header trx id 10024296579 lock_mode X locks rec but not gap
Record lock, heap no 9 PHYSICAL RECORD: n_fields 182; compact format; info bits 0
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 5795 page no 316314 n bits 80 index PRIMARY of table itoc-wms-prod.shipment_header trx id 10024296579 lock_mode X locks rec but not gap waiting
Record lock, heap no 5 PHYSICAL RECORD: n_fields 182; compact format; info bits 0
In this MySQL deadlock log, we can see that there are two transactions, with transaction IDs 10024296578 and 10024296579 respectively. Transaction 1 is attempting to update rows in the shipment_header table and is waiting for a lock to be granted on a specific record. Transaction 2 already holds a lock on that record and is attempting to update it, but is waiting for a lock to be granted on a different record.
This results in a deadlock, where both transactions are waiting for each other to release a lock. In this case, the only way to resolve the deadlock is for one of the transactions to be rolled back, allowing the other transaction to proceed and complete its operation
 
原文地址: https://www.cveoy.top/t/topic/fjpB 著作权归作者所有。请勿转载和采集!