Details
Description
As explained in upstream bug reports (that has all the details on the test case):
http://bugs.mysql.com/bug.php?id=82127
https://bugs.launchpad.net/percona-server/+bug/1598822
there is a deadlock scenario with 3 concurrent DELETEs by UNIQUE key that can not be explained by the manual:
CREATE TABLE `tu`(`id` int(11), `a` int(11) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` varchar(10) DEFAULT NULL, PRIMARY KEY(`id`), UNIQUE KEY `u`(`a`,`b`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=0;
|
|
insert into tu values(1,1,'a','a'),(2,9999,'xxxx','x'),(3,10000,'b','b'),(4,4,'c','c');
|
|
mysqlslap -uroot --concurrency=3 --create-schema=test --no-drop --number-of-queries=1000 --query="delete from tu where a = 9999 and b = 'xxxx'"
|
mysqlslap: Cannot run query delete from tu where a = 9999 and b = 'xxxx' ERROR : Deadlock found when trying to get lock; try restarting transaction
|
Deadlock happens both with triggers mentioned in that bug reports and without them (just less often).
The problem was originally noted by customer on MariaDB 5.5.24, but affects all released versions up to those based on InnoDB from 5.7.x for sure.
As there is no visible progress on upstream bugs, I create this bug report for MariaDB to decide if there is anything to fix here or to document clearly in the knowledge base.
Attachments
Issue Links
- is blocked by
-
MDEV-27025 insert-intention lock conflicts with waiting ORDINARY lock
- Closed
- relates to
-
MDEV-14589 InnoDB should not lock a delete-marked record
- Closed
-
MDEV-16232 Use fewer mini-transactions
- Stalled
-
MDEV-16402 Support Index Condition Pushdown for clustered PK scans
- Confirmed
-
MDEV-16406 Refactor the InnoDB record locks
- Open
-
MDEV-18706 ER_LOCK_DEADLOCK on concurrent read and insert into already locked gap
- In Review
-
MDEV-31833 replication breaks when using optimistic replication and replica is a galera node
- Closed
-
MDEV-20605 Awaken transaction can miss inserted by other transaction records due to wrong persistent cursor restoration
- Closed
-
MDEV-22698 Deadlock on concurrent acquisition from multiple indexes
- Open
-
MDEV-23560 Deadlock detected on SELECT when only one record being processed
- Open
-
MDEV-28800 SIGABRT due to running out of memory for InnoDB locks
- Closed
- links to
- mentioned in
-
Page Loading...