I a need a database level synchronization. For this I'm using GET_LOCK('prefix.some_id', 0). At some moment GET_LOCK returns 1 for same key in different scripts on different hosts. What could be the problem? I need lots of those locks, 5-7k approximately.
Any ideas?
MySQL 5.7.5 and MariaDB 10.0.2 both support your use case now.
For MySQL see: https://dev.mysql.com/doc/refman/5.7/en/locking-functions.html
For MariaDB see: https://mariadb.com/kb/en/mariadb/documentation/functions-and-operators/miscellaneous-functions/get_lock/
Bug #1118 Allow multiple concurrent locks with GET_LOCK()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With