Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1956

DEALOCK why are locks hold by transaction 1 not shown (no replies)

$
0
0
Hi

I run with innodb status logging in MySQL error.log (CREATE TABLE innodb_lock_monitor (a INT) ENGINE=INNODB;)

Every time I see a deadlock it always shows a section "WAITING FOR THIS LOCK TO BE GRANTED" for transaction 1, and "HOLDS THE LOCK(S)" and "WAITING FOR THIS LOCK TO BE GRANTED" sections for transaction 2.

Why are there no "HOLDS THE LOCK(S)" section for transaction 1? Guess a transaction cannot be involved in a deadlock unless it holds at least one lock (the one transaction 2 wants)?

Regards, Per Steffensen

Example:
------------------------
LATEST DETECTED DEADLOCK
------------------------
110126 8:22:52
*** (1) TRANSACTION:
TRANSACTION 1AF6AC, ACTIVE 0 sec, process no 9646, OS thread id 140412887099152 starting index read
mysql tables in use 10, locked 3
LOCK WAIT 4 lock struct(s), heap size 1216, 2 row lock(s), undo log entries 1
MySQL thread id 231, query id 44545800 ubuntu104template-6.local 192.168.99.146 root Updating
/* */ ...
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS ...
Record lock ... one of those that transaction 2 holds ...

*** (2) TRANSACTION:
TRANSACTION 1AF6AE, ACTIVE 0 sec, process no 9646, OS thread id 140412900144912 starting index read
mysql tables in use 1, locked 1
10 lock struct(s), heap size 1216, 20 row lock(s), undo log entries 13
MySQL thread id 63, query id 44545850 ubuntu104template-4.local 192.168.99.144 root updating
/* */ ...
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS …
Record lock …

Record lock …



*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS …
Record lock …

*** WE ROLL BACK TRANSACTION (1)

Viewing all articles
Browse latest Browse all 1956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>