Announcement

Announcement Module
Collapse
No announcement yet.

What is the readlock for when copying data?

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • What is the readlock for when copying data?

    The tutorials / docs for setting up replication, suggest using a read lock before copying data eg:

    FLUSH TABLES WITH READ LOCK;
    SET GLOBAL read_only = ON;

    What is the lock for?

    My testing suggests that using a Read Lock inserts will wait, which could cause our webservers to fall over as the requests start to stack up. While jut setting read_only with no lock will cause inserts to fail quickly; which is not ideal, but shouldn't crash the webservers )

    So why does everywhere say to use the read lock? What benefit is it?

    thanks

  • #2
    Because to set up a replication slave you need a consistent copy of your data at a single point in time.

    Comment

    Working...
    X