Added error handling in BINLOG_DUMP phase

Added error handling in BINLOG_DUMP phase: router goes into
BLRM_SLAVE_STOPPED state

Removed blr_file_add_magic called twice
This commit is contained in:
MassimilianoPinto
2015-06-22 10:35:02 +02:00
parent 64bb68c12c
commit 5bc07c5100
3 changed files with 13 additions and 5 deletions

View File

@ -246,6 +246,9 @@ blr_master_reconnect(ROUTER_INSTANCE *router)
{
int do_reconnect = 0;
if (router->master_state == BLRM_SLAVE_STOPPED)
return;
spinlock_acquire(&router->lock);
if (router->active_logs)
{
@ -914,7 +917,8 @@ static REP_HEADER phdr;
blr_extract_header(ptr, &hdr);
if (hdr.event_size != len - 5) /* Sanity check */
/* Sanity check */
if (hdr.ok == 0 && hdr.event_size != len - 5)
{
LOGIF(LE,(skygw_log_write(
LOGFILE_ERROR,
@ -1146,6 +1150,9 @@ static REP_HEADER phdr;
free(router->m_errmsg);
router->m_errmsg = msg_err;
/* Force stopped state */
router->master_state = BLRM_SLAVE_STOPPED;
spinlock_release(&router->lock);
LOGIF(LE,(skygw_log_write(LOGFILE_ERROR,