hardStudy question · answer published in MySQL interview questions, so no pointstransactionsmysqldeadlocks
Deadlock from two concurrent inserts
In MySQL at Repeatable Read, two sessions each run SELECT ... FOR UPDATE for a missing id in the same gap, then each INSERT that id range. Both block and one is killed as a deadlock victim. Why?
Discussion 0
Join free to post in the discussion.
Related questions
- Durability in ACIDDatabase Administrator
- Why a write-ahead log existsDatabase Administrator
- What ROLLBACK undoesDatabase Administrator
- Why InnoDB over MyISAMDatabase Administrator
- Finding slow MySQL queriesDatabase Administrator
- How InnoDB stores table rowsDatabase Administrator
- What an InnoDB secondary index points toDatabase Administrator
- type = ALL in MySQL EXPLAINDatabase Administrator