start slave may create a new binlog file

start slave may create a new binlog file
This commit is contained in:
MassimilianoPinto
2015-06-23 10:05:39 +02:00
parent 2816d87013
commit 022179ca12
2 changed files with 34 additions and 0 deletions

View File

@ -2320,6 +2320,13 @@ blr_start_slave(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave)
spinlock_acquire(&router->lock);
router->master_state = BLRM_UNCONNECTED;
spinlock_release(&router->lock);
/* create a new binlog or just use current one */
if (strcmp(router->prevbinlog, router->binlog_name))
blr_file_new_binlog(router, router->binlog_name);
else
blr_file_use_binlog(router, router->binlog_name);
blr_start_master(router);
return blr_slave_send_ok(router, slave);