tag:blogger.com,1999:blog-31421954.post5593774979327982229..comments2023-10-30T08:23:12.960-07:00Comments on mySQL DBA, Architecture, Dev, Scale, HA, Code : Distributed Locking Solving it with mySQLDathan Pattishallhttp://www.blogger.com/profile/00356367514107959723noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-31421954.post-48338633815475305622008-06-26T12:10:00.000-07:002008-06-26T12:10:00.000-07:00IS_LOCK_FREE and GET_LOCK works fine in a cluster ...IS_LOCK_FREE and GET_LOCK works fine in a cluster enviroment?<BR/>I want to know if the get_lock get a lock over all servers in the cluster or only in the server who perform the query.<BR/>ThanksUnknownhttps://www.blogger.com/profile/03904271304013623358noreply@blogger.comtag:blogger.com,1999:blog-31421954.post-56744937535514183612008-01-02T20:44:00.000-08:002008-01-02T20:44:00.000-08:00ha your rightha your rightDathan Pattishallhttps://www.blogger.com/profile/00356367514107959723noreply@blogger.comtag:blogger.com,1999:blog-31421954.post-18720683720649680342007-12-22T14:02:00.000-08:002007-12-22T14:02:00.000-08:00You mean it's IS_FREE_LOCK as you have a typo by c...You mean it's IS_FREE_LOCK as you have a typo by calling it IS_LOCK_FREE.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-31421954.post-29526039848860779282007-12-18T10:32:00.000-08:002007-12-18T10:32:00.000-08:00I should of tested that. I thought that GET_LOCK(l...I should of tested that. I thought that GET_LOCK(lock,0) would block, until the lock is free, but it does not. I will change this now.Dathan Pattishallhttps://www.blogger.com/profile/00356367514107959723noreply@blogger.comtag:blogger.com,1999:blog-31421954.post-87229676281577879172007-12-15T23:40:00.000-08:002007-12-15T23:40:00.000-08:00If you do:IS_LOCK_FREE(lock)GET_LOCK(lock)... you ...If you do:<BR/><BR/>IS_LOCK_FREE(lock)<BR/><BR/>GET_LOCK(lock)<BR/><BR/>... you have a race condition, I'm pretty sure?<BR/><BR/>I think you mean:<BR/><BR/>GET_LOCK(lock, 0)<BR/><BR/>which will return instantly if the lock is lost, and is atomic.Anonymousnoreply@blogger.com