隔离级别
REPEATABLE-READ
并发也不高,qps 估计 10 以内
CREATE TABLE `tb` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`convert_key` varchar(200) NOT NULL COMMENT 'a',
`convert_status` tinyint(8) NOT NULL COMMENT 'a',
`error_msg` varchar(256) NOT NULL,
`convert_type` varchar(128) NOT NULL,
`sid` varchar(128) NOT NULL COMMENT 'a',
`create_time` bigint(20) NOT NULL,
`modify_time` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_convert_key` (`convert_key`) USING BTREE,
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB AUTO_INCREMENT=19785 DEFAULT CHARSET=utf8;
------------------------
LATEST DETECTED DEADLOCK
------------------------
*** (1) TRANSACTION:
TRANSACTION 107851589284, ACTIVE 0 sec updating or deleting
mysql tables in use 1, locked 1
LOCK WAIT 5 lock struct(s), heap size 1136, 4 row lock(s), undo log entries 1
MySQL thread id 2012848, OS thread handle 70370117332960, query id 28214859058 ww update
replace into tb set modify_time=1704268105,convert_status=1,convert_key='4dfbecb0ba209a',convert_type='pdf2excel',create_time=1704268105,sid='645cbb3582'
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 1186 page no 543732 n bits 0 index PRIMARY of table `tb` trx id 107851589284 lock_mode X locks gap before rec insert intention waiting
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
0: len=8; bufptr=0x4003257e8070; hex= 73757072656d756d; asc supremum;;
*** (2) TRANSACTION:
TRANSACTION 107851589283, ACTIVE 0 sec updating or deleting
mysql tables in use 1, locked 1
LOCK WAIT 6 lock struct(s), heap size 1136, 5 row lock(s), undo log entries 1
MySQL thread id 2013484, OS thread handle 70369103069152, query id 28214859053 ww update
replace into tb set modify_time=1704268105,convert_status=1,convert_key='5e846da1374180679',convert_type='pdf2ppt',create_time=1704268105,sid='ce2b6ea5671'
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 1186 page no 543732 n bits 0 index PRIMARY of table `tb` trx id 107851589283 lock_mode X
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
0: len=8; bufptr=0x4003257e8070; hex= 73757072656d756d; asc supremum;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 1186 page no 543732 n bits 0 index PRIMARY of table `tb` trx id 107851589283 lock_mode X locks gap before rec insert intention waiting
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
0: len=8; bufptr=0x4003257e8070; hex= 73757072656d756d; asc supremum;;
*** WE ROLL BACK TRANSACTION (1)