People say that to have a good vacation, you need to do something
else, something you don't do every day at work.
So, instead of hacking on Tarantool, I did some good old MySQL hacking.
Thanks to Alexey Rybak from Badoo I had a nice opportunity for it
-- a task to improve MySQL user level locks.
GET_LOCK() function in MySQL allows a connection to hold at most
one user level lock. Taking a new lock automatically releases the
old lock, if any.
The limit of one lock per session existed since early versions of
MySQL didn't have a deadlock detector for SQL locks. MDL patches
in MySQL 5.5 added a deadlock detector, so starting from 5.5 it
became possible to take multiple locks in any order -- a
deadlock, should it occur, would be detected and an error
returned to the client that closed the wait chain.
So, thanks to MDL, implementing user level locks seemed to be an
easy task, …