MySQL Forums
Forum List  »  MyISAM

LOCK replication safe?
Posted by: Brad Proctor
Date: February 08, 2013 01:09PM

We have master-slave replication using MyISAM tables. I'm wondering if a LOCK will block a SELECT on a slave.

I have a situation where only one can be active at any given time.

LOCK TABLE tbl WRITE;
UPDATE tbl SET status = 0 WHERE loc = 'A';
<---- (from slave) SELECT * FROM tbl WHERE loc = 'A' AND status = 1;
INSERT tbl (loc, status) VALUES ('A', 1);
UNLOCK TABLES;

This would normally block the SELECT until after the table was unlocked, but will this work if the SELECT is coming from a slave?

If not, is there another way to do this?

Thanks,
Brad

Options: ReplyQuote


Subject
Views
Written By
Posted
LOCK replication safe?
2677
February 08, 2013 01:09PM
1580
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.