Jeremy D. Zawodny wrote:

> On Wed, Jan 17, 2001 at 11:16:27PM -0800, Mike Wexler wrote:
> 
> 
>> This is a big improvement. What would be really cool would be to
> 
>> read lock a table, copy it to the slave, and then tell the slave to
> 
>> start paying attention to the binary log for *that* table. Then it
> 
>> would repeat this for all tables. During the process, that slave
> 
>> would have inconsistent versions of the database, but at the end the
> 
>> slave would be entirely consistent with the master.
> 
> 
> 
> Yeah, but that would also be quite a bit more tricky to program. :-(
> 
> 
> 
> I've got the first version of `myrepl' half done already, so I'll know
> 
> real soon if this is likely to do the trick. If this works, I'll think
> 
> harder about how to do this on a per-db (or per-table) basis. But I
> 
> might not try *too* hard, knowing that the MySQL team is working to
> 
> make this easier on their end, too.

Actually, I'm pretty sure it would need to be done in the MySQL server. 
It could be done with either the master or the slave, but I think the 
slave would be cleaner.

When I first read the documentation I thought that
        LOAD TABLE tblname FROM MASTER
would do the trick. I figured you would set up the server to handle 
replication. Set of the client. Run LOAD TABLE tblname FROM master for 
each table and be done. If LOAD TABLE read-locked the master and turned 
on replication for that table, this would actually work really nicely.

Given the current implementation of MySQL it should be possible to write 
a script that locked all the tables in a database (but not all 
databases). Copied the files from the master to the slave. Started up 
replication for that database by adding another:

        binlog-do-db=database_name

to the slaves my.cnf and restarting the slave.  I don't see anyway of 
implementing the mysqlhotrepl with a finer locking granularity than 
table level without modifying the implementation of the MySQL server.

> 
> 
> 
> 
>>> Damn. And I was planning on going to bed early...
> 
>> 
>> There is always tomorrow...
> 
> 
> 
> Good point. I'll sleep tomorrow. :-)

You must not have kids :-)



---------------------------------------------------------------------
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