Resolve issue with icorrectly markign slave connection as errored

This commit is contained in:
Mark Riddoch
2014-10-21 14:31:05 +01:00
parent 554a054e18
commit 932fc5dc2c
5 changed files with 61 additions and 6 deletions

View File

@ -810,7 +810,10 @@ uint8_t *ptr;
}
else
{
if (router->rotating != 0 && strcmp(router->binlog_name, slave->binlogfile) != 0)
if (slave->binlog_pos >= blr_file_size(slave->file)
&& router->rotating == 0
&& strcmp(router->binlog_name, slave->binlogfile) != 0
&& blr_master_connected(router))
{
/* We may have reached the end of file of a non-current
* binlog file.
@ -821,9 +824,11 @@ uint8_t *ptr;
* we ignore these issues during the rotate processing.
*/
LOGIF(LE, (skygw_log_write(LOGFILE_ERROR,
"Slave reached end of file for binlong file %s "
"which is not the file currently being downloaded.",
slave->binlogfile)));
"Slave reached end of file for binlong file %s at %u "
"which is not the file currently being downloaded. "
"Master binlog is %s, %lu.",
slave->binlogfile, slave->binlog_pos,
router->binlog_name, router->binlog_position)));
slave->state = BLRS_ERRORED;
}
else