Fix to allow rotate of files without explicit rotate events when the master is offline

This commit is contained in:
Mark Riddoch
2015-02-06 11:45:20 +00:00
parent bc0d303b27
commit 25e39f35c5
2 changed files with 27 additions and 3 deletions

View File

@ -1440,7 +1440,8 @@ if (hkheartbeat - beat1 > 1) LOGIF(LE, (skygw_log_write(
if (slave->binlog_pos >= blr_file_size(slave->file)
&& router->rotating == 0
&& strcmp(router->binlog_name, slave->binlogfile) != 0
&& blr_master_connected(router))
&& (blr_master_connected(router)
|| blr_file_next_exists(router, slave)))
{
/* We may have reached the end of file of a non-current
* binlog file.
@ -1470,7 +1471,7 @@ if (hkheartbeat - beat1 > 1) LOGIF(LE, (skygw_log_write(
dcb_close(slave->dcb);
}
}
else
else if (blr_master_connected(router))
{
spinlock_acquire(&slave->catch_lock);
slave->cstate |= CS_EXPECTCB;