8.0 - LP #1598822: Deadlock with 3 concurrent DELETEs by unique key and triggers reading the same row

Description

**Reported in Launchpad by Valerii Kravchuk last update 27-08-2016 20:33:23

I have reasons to think that this bug is repeatable on upstream MySQL starting from 5.5.24 at least, but as I can not reproduce it on Oracle's MySQL 5.7.11 and can easily reproduce on Percona Server 5.7.12, I decided to report it here first and then let you work on details.

Here it is:

Now let's run 3 concurrent DELETEs of the row referenced in triggers using mysqlslap:

Let's check deadlock details:

Now, go on and explain this deadlock. Why transaction that holds the record lock on unique secondary index may need the next-key lock on the same index and so on. Have fun!

I'll add more details about versions affected as soon as I get this bug reproduced on them.

Environment

None

Smart Checklist

Activity

Show:
Done

Details

Assignee

Reporter

Upstream Bug URL

Fix versions

Affects versions

Priority

Smart Checklist

Created February 3, 2020 at 4:55 PM
Updated March 6, 2024 at 11:22 AM
Resolved February 3, 2020 at 4:56 PM