MySQL Forums
Forum List  »  MyISAM

Re: LOCK replication safe?
Posted by: Rick James
Date: February 09, 2013 12:55PM

Probably cannot do what you are suggesting.

Replication is asynchronous. That is, statements (LOCK, UPDATE, etc) (here, I am assuming "Statement Based Replication) are performed on the Master. As each one is completed (in MyISAM), it is sent to the Slave. Sooner or later, the Slave will perform the same query. Usually, this is a fraction of a second after it was performed on the Master. But if, say, the network were down, it could take hours before the Slave does the queries. By then, the Master has finished with the UNLOCK, and is busy doing other things.

Please explain what you are trying to do (at a higher level); we may be able to suggest a different approach.

Percona XtraDB Cluster might achieve what you want. But you would need to switch to InnoDB (XtraDB), and rewrite your code to use BEGIN...COMMIT instead of LOCK...UNLOCK. (No BEGIN...COMMIT is not exactly a drop-in replacement for LOCK...UNLOCK.)

Options: ReplyQuote


Subject
Views
Written By
Posted
2536
February 08, 2013 01:09PM
Re: LOCK replication safe?
1487
February 09, 2013 12:55PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.