Hi.

On Sat, Sep 22, 2001 at 03:38:45PM +0200, [EMAIL PROTECTED] wrote:
> 
>       I have some questions about MySQL replication and table locking:
> 1. If I lock a table on  the master server, the table will be locked on
> the slave server?

It will be locked whenever the slave gets to execute the query. It is
more obvious if you imagine the case where the connection to the
master was unavailable for a day and you told the slave to catch up.

> 2. If I use replication, the locking queues are the same on both servers?

No. The locking queues are deterministic in such a way that the same
sequence of commands produces the same locking behaviour. Because the
slave executes the same commands as the master, it will get
theoretically the same locking queues. But in real, there can get
queries from other clients from the slave in between.

For most of the table types of MySQL, that isn't important at all,
because there will cannot be any deadlock. I don't know about BDB,
however, but assume the slave to retry automatically.

> 3. If my master fails (or I turn off the server) and there was a running
> process which locked a table, the table on the slave server remains locked
> or not?

AFAIK, if the slave is in such a state (incomplete "transaction") it
will fail and ask for adminstrator intervention. The table would be
unlocked in this case.

But, you could very easily test that case and tell us the result.

Bye,

        Benjamin.


-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to