MySQL Deadlock Log Analysis

Source: Internet
Author: User
Tags compact

  1. ------------------------
  2. LATEST detected DEADLOCK
  3. ------------------------
  4. 140824 1:01:24
  5. (1) TRANSACTION:
  6. TRANSACTION 110E, active starting SEC index Read # # transaction id=110E, active 73s
  7. MySQL tables in use 1, locked 1
  8. Lock WAIT 3 lock struct (s), Heap size 376, 2 row lock (s) # # There are 2 row locks
  9. MySQL thread ID 1, OS thread handle 0x7f55ea639700, query ID bayi localhost root updating # # threads for the transaction id=1
  10. Delete from T1 where a=1 # # This is the SQL that the current transaction executes
  11. (1) Waiting for the lock to be granted: # # above SQL waits for the locking information
  12. RECORD LOCKS Space ID page No 3 n bits index ' PRIMARY ' of table ' test '. ' T1 ' Trx ID 110E lock_mode X LOCKS Rec But no T gap waiting
  13. Record Lock, Heap No 2 physical record:n_fields 4; Compact format; Info bits 32 # # Wait on the primary key on page num=3 with an X lock (not gap waiting), lock the bits
  14. 0:len 4; Hex 80000001; ASC;;
  15. 1:len 6; Hex 00000000110c; ASC;;
  16. 2:len 7; Hex 0d000002350084; ASC 5;;
  17. 3:len 4; Hex 80000001; ASC;;
  18. (2) TRANSACTION:
  19. TRANSACTION 110C, active 1716 SEC starting index read, thread declared inside InnoDB 500 # # transactions id=110C, active 1716s /c1>
  20. MySQL tables in use 1, locked 1
  21. 3 lock struct (s), Heap size 376, 2 row lock (s), undo log Entries 1 # # 3 lock, 2 row lock, 1 undo Log
  22. MySQL thread ID 2, OS thread handle 0x7f563c05e700, query ID of updating localhost root # # # threads for the transaction id=2
  23. Delete from T1 where a=3 # # This is the SQL that the current transaction executes
  24. (2) holds the Lock (S): # # This transaction holds the lock information
  25. RECORD LOCKS Space ID page No 3 n bits index ' PRIMARY ' of table ' test '. ' T1 ' Trx ID 110C lock_mode X LOCKS Rec But no T gap
  26. Record Lock, Heap No 2 physical record:n_fields 4; Compact format; Info bits 32 # # on the primary key on page num=3 already holds an X lock (not gap), lock the bits
  27. 0:len 4; Hex 80000001; ASC;;
  28. 1:len 6; Hex 00000000110c; ASC;;
  29. 2:len 7; Hex 0d000002350084; ASC 5;;
  30. 3:len 4; Hex 80000001; ASC;;
  31. (2) Waiting for the lock to be granted: # # at the same time this transaction also waits for the locking information
  32. RECORD LOCKS Space ID page No 3 n bits index ' PRIMARY ' of table ' test '. ' T1 ' Trx ID 110C lock_mode X LOCKS Rec But no T gap waiting
  33. Record Lock, Heap No 3 physical record:n_fields 4; Compact format; Info bits 0 # # also waits on page num= 3 on the primary key to have an X lock (not gap waiting), lock the bits
  34. 0:len 4; Hex 80000003; ASC;;
  35. 1:len 6; Hex 000000000f71; ASC q;;
  36. 2:len 7; Hex ed0000022f0090; ASC/;;
  37. 3:len 4; Hex 80000003; ASC;;
  38. WE Roll Back TRANSACTION (1) # # Here Choose ROLLBACK TRANSACTION 110E.
  39. In other words, this deadlock uses SQL in transaction 110E without execution and rolls back:
  40. Delete from T1 where a=1
  41. The SQL in transaction 110C is executed normally:
  42. Delete from T1 where a=3

MySQL Deadlock Log Analysis

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.