Are the reasons behind deadlocks with highly concurrent inserts also the same for highly concurrent updates?
For whatever reason I have two threads running the EXACT same SQL and InnoDB is reporting a deadlock? Help!?
------------------------
LATEST DETECTED DEADLOCK
------------------------
101227 21:37:39
*** (1) TRANSACTION:
TRANSACTION 9D01C, ACTIVE 0 sec, OS thread id 3768 starting index read
mysql tables in use 1, locked 1
LOCK WAIT 15 lock struct(s), heap size 3112, 7 row lock(s), undo log entries 4
MySQL thread id 1034, query id 170384 localhost 127.0.0.1 root Updating
update drawing set SUBMISSION_COUNT=2928 where DRAW_ID=0
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 180255 n bits 72 index `PRIMARY` of table `FOO`.`drawing` trx id 9D01C lock_mode X locks rec but not gap waiting
Record lock, heap no 2 PHYSICAL RECORD: n_fields 14; compact format; info bits 0
0: len 8; hex 8000000000000000; asc ;;
1: len 6; hex 00000009d018; asc ;;
2: len 7; hex 1b0001c02c0360; asc , `;;
3: len 8; hex 8000124a3f6d2f40; asc J?m/@;;
4: len 8; hex 8000000000000000; asc ;;
5: len 8; hex 800012481b105340; asc H S@;;
6: len 8; hex 800012482ebbb9c0; asc H. ;;
7: len 8; hex 800012481b105340; asc H S@;;
8: len 8; hex 800012482ebbb9c0; asc H. ;;
9: len 8; hex 8000124a3fd7ff00; asc J? ;;
10: len 1; hex 4e; asc N;;
11: len 8; hex 8000000000000b6f; asc o;;
12: len 1; hex 4f; asc O;;
13: len 8; hex 800012482e81f337; asc H. 7;;
*** (2) TRANSACTION:
TRANSACTION 9D01B, ACTIVE 0 sec, OS thread id 5412 starting index read, thread declared inside InnoDB 500
mysql tables in use 1, locked 1
15 lock struct(s), heap size 3112, 7 row lock(s), undo log entries 4
MySQL thread id 1035, query id 170385 localhost 127.0.0.1 root Updating
update drawing set SUBMISSION_COUNT=2928 where DRAW_ID=0
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 0 page no 180255 n bits 72 index `PRIMARY` of table `FOO`.`drawing` trx id 9D01B lock mode S locks rec but not gap
Record lock, heap no 2 PHYSICAL RECORD: n_fields 14; compact format; info bits 0
0: len 8; hex 8000000000000000; asc ;;
1: len 6; hex 00000009d018; asc ;;
2: len 7; hex 1b0001c02c0360; asc , `;;
3: len 8; hex 8000124a3f6d2f40; asc J?m/@;;
4: len 8; hex 8000000000000000; asc ;;
5: len 8; hex 800012481b105340; asc H S@;;
6: len 8; hex 800012482ebbb9c0; asc H. ;;
7: len 8; hex 800012481b105340; asc H S@;;
8: len 8; hex 800012482ebbb9c0; asc H. ;;
9: len 8; hex 8000124a3fd7ff00; asc J? ;;
10: len 1; hex 4e; asc N;;
11: len 8; hex 8000000000000b6f; asc o;;
12: len 1; hex 4f; asc O;;
13: len 8; hex 800012482e81f337; asc H. 7;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 180255 n bits 72 index `PRIMARY` of table `FOO`.`drawing` trx id 9D01B lock_mode X locks rec but not gap waiting
Record lock, heap no 2 PHYSICAL RECORD: n_fields 14; compact format; info bits 0
0: len 8; hex 8000000000000000; asc ;;
1: len 6; hex 00000009d018; asc ;;
2: len 7; hex 1b0001c02c0360; asc , `;;
3: len 8; hex 8000124a3f6d2f40; asc J?m/@;;
4: len 8; hex 8000000000000000; asc ;;
5: len 8; hex 800012481b105340; asc H S@;;
6: len 8; hex 800012482ebbb9c0; asc H. ;;
7: len 8; hex 800012481b105340; asc H S@;;
8: len 8; hex 800012482ebbb9c0; asc H. ;;
9: len 8; hex 8000124a3fd7ff00; asc J? ;;
10: len 1; hex 4e; asc N;;
11: len 8; hex 8000000000000b6f; asc o;;
12: len 1; hex 4f; asc O;;
13: len 8; hex 800012482e81f337; asc H. 7;;
*** WE ROLL BACK TRANSACTION (2)
For whatever reason I have two threads running the EXACT same SQL and InnoDB is reporting a deadlock? Help!?
------------------------
LATEST DETECTED DEADLOCK
------------------------
101227 21:37:39
*** (1) TRANSACTION:
TRANSACTION 9D01C, ACTIVE 0 sec, OS thread id 3768 starting index read
mysql tables in use 1, locked 1
LOCK WAIT 15 lock struct(s), heap size 3112, 7 row lock(s), undo log entries 4
MySQL thread id 1034, query id 170384 localhost 127.0.0.1 root Updating
update drawing set SUBMISSION_COUNT=2928 where DRAW_ID=0
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 180255 n bits 72 index `PRIMARY` of table `FOO`.`drawing` trx id 9D01C lock_mode X locks rec but not gap waiting
Record lock, heap no 2 PHYSICAL RECORD: n_fields 14; compact format; info bits 0
0: len 8; hex 8000000000000000; asc ;;
1: len 6; hex 00000009d018; asc ;;
2: len 7; hex 1b0001c02c0360; asc , `;;
3: len 8; hex 8000124a3f6d2f40; asc J?m/@;;
4: len 8; hex 8000000000000000; asc ;;
5: len 8; hex 800012481b105340; asc H S@;;
6: len 8; hex 800012482ebbb9c0; asc H. ;;
7: len 8; hex 800012481b105340; asc H S@;;
8: len 8; hex 800012482ebbb9c0; asc H. ;;
9: len 8; hex 8000124a3fd7ff00; asc J? ;;
10: len 1; hex 4e; asc N;;
11: len 8; hex 8000000000000b6f; asc o;;
12: len 1; hex 4f; asc O;;
13: len 8; hex 800012482e81f337; asc H. 7;;
*** (2) TRANSACTION:
TRANSACTION 9D01B, ACTIVE 0 sec, OS thread id 5412 starting index read, thread declared inside InnoDB 500
mysql tables in use 1, locked 1
15 lock struct(s), heap size 3112, 7 row lock(s), undo log entries 4
MySQL thread id 1035, query id 170385 localhost 127.0.0.1 root Updating
update drawing set SUBMISSION_COUNT=2928 where DRAW_ID=0
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 0 page no 180255 n bits 72 index `PRIMARY` of table `FOO`.`drawing` trx id 9D01B lock mode S locks rec but not gap
Record lock, heap no 2 PHYSICAL RECORD: n_fields 14; compact format; info bits 0
0: len 8; hex 8000000000000000; asc ;;
1: len 6; hex 00000009d018; asc ;;
2: len 7; hex 1b0001c02c0360; asc , `;;
3: len 8; hex 8000124a3f6d2f40; asc J?m/@;;
4: len 8; hex 8000000000000000; asc ;;
5: len 8; hex 800012481b105340; asc H S@;;
6: len 8; hex 800012482ebbb9c0; asc H. ;;
7: len 8; hex 800012481b105340; asc H S@;;
8: len 8; hex 800012482ebbb9c0; asc H. ;;
9: len 8; hex 8000124a3fd7ff00; asc J? ;;
10: len 1; hex 4e; asc N;;
11: len 8; hex 8000000000000b6f; asc o;;
12: len 1; hex 4f; asc O;;
13: len 8; hex 800012482e81f337; asc H. 7;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 180255 n bits 72 index `PRIMARY` of table `FOO`.`drawing` trx id 9D01B lock_mode X locks rec but not gap waiting
Record lock, heap no 2 PHYSICAL RECORD: n_fields 14; compact format; info bits 0
0: len 8; hex 8000000000000000; asc ;;
1: len 6; hex 00000009d018; asc ;;
2: len 7; hex 1b0001c02c0360; asc , `;;
3: len 8; hex 8000124a3f6d2f40; asc J?m/@;;
4: len 8; hex 8000000000000000; asc ;;
5: len 8; hex 800012481b105340; asc H S@;;
6: len 8; hex 800012482ebbb9c0; asc H. ;;
7: len 8; hex 800012481b105340; asc H S@;;
8: len 8; hex 800012482ebbb9c0; asc H. ;;
9: len 8; hex 8000124a3fd7ff00; asc J? ;;
10: len 1; hex 4e; asc N;;
11: len 8; hex 8000000000000b6f; asc o;;
12: len 1; hex 4f; asc O;;
13: len 8; hex 800012482e81f337; asc H. 7;;
*** WE ROLL BACK TRANSACTION (2)