这个死锁原因是什么?
LATEST DETECTED DEADLOCK
------------------------
2017-11-27 11:26:22 2b80ab881700
*** (1) TRANSACTION:
TRANSACTION 84983140, ACTIVE 3.138 sec inserting
mysql tables in use 1, locked 1
LOCK WAIT 13 lock struct(s), heap size 2936, 9 row lock(s), undo log entries 102
LOCK BLOCKING MySQL thread id: 4188408 block 4188409
MySQL thread id 4188409, OS thread handle 0x2b80c834c700, query id 1119236930 119.23.142.11
all5 update
INSERT INTO t_flow_real_time( `spot`,`group_quantity`,`booking`,`statistics_time` )
values ( 1,1,'2017-11-24','2017-11-27 11:26:21.007' )
ON DUPLICATE KEY UPDATE
`group_quantity` = group_quantity + 1
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 1258 page no 4 n bits 104 index `idx_unique` of table `a_analysis`.`t_flow_real_time` trx id 84983140 lock_mode X waiting
Record lock, heap no 33 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
0: len 4; hex 80000001; asc ;;
1: len 3; hex 8fc378; asc x;;
2: len 4; hex 8000984d; asc M;;
*** (2) TRANSACTION:
TRANSACTION 84983143, ACTIVE 1.554 sec inserting
mysql tables in use 1, locked 1
13 lock struct(s), heap size 2936, 9 row lock(s), undo log entries 46
MySQL thread id 4188408, OS thread handle 0x2b80ab881700, query id 1119237503 119.23.142.11
all580 update
INSERT INTO t_flow_real_time ( `spot`, `group_quantity`, `booking`, `statistics_time` )
values ( 1, 1, '2017-11-26', '2017-11-27 11:26:22.407' )
ON DUPLICATE KEY UPDATE
`group_quantity` = group_quantity + 1
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 1258 page no 4 n bits 104 index `idx_unique` of table `a_analysis`.`t_flow_real_time` trx id 84983143 lock_mode X
Record lock, heap no 33 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
0: len 4; hex 80000001; asc ;;
1: len 3; hex 8fc378; asc x;;
2: len 4; hex 8000984d; asc M;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 1258 page no 4 n bits 104 index `idx_unique` of table `a_analysis`.`t_flow_real_time` trx id 84983143 lock_mode X waiting
Record lock, heap no 34 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
0: len 4; hex 80000001; asc ;;
1: len 3; hex 8fc37a; asc z;;
2: len 4; hex 8000987b; asc {;;
*** WE ROLL BACK TRANSACTION (2)