1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

This one will not be pushed, I am committing to be able to pull in Monty's changes

added server id, mostly working
added --skip-slave-start, working
added --replicate-rewrite-db - just in the cmd line parses, currently noop
This commit is contained in:
sasha@mysql.sashanet.com
2000-09-28 16:24:50 -06:00
parent 1148accfa3
commit ea0f48ffb2
9 changed files with 172 additions and 64 deletions

View File

@ -797,11 +797,17 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
THD *thd;; // needs to be first for thread_stack
MYSQL *mysql = NULL ;
if(!server_id)
{
sql_print_error("Server id not set, will not start slave");
pthread_exit(1);
}
pthread_mutex_lock(&LOCK_slave);
if(slave_running)
{
pthread_mutex_unlock(&LOCK_slave);
return 0; // safety just in case
pthread_exit(1); // safety just in case
}
slave_running = 1;
abort_slave = 0;
@ -938,7 +944,7 @@ static void safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi)
while(!slave_killed(thd) && mc_mysql_reconnect(mysql))
{
sql_print_error(
"Slave thread: error connecting to slave:%s, retry in %d sec",
"Slave thread: error connecting to master:%s, retry in %d sec",
mc_mysql_error(mysql), mi->connect_retry);
safe_sleep(thd, mi->connect_retry);
}