Addition of slave transition to catchup mode in logging

Addition of slave transition to catchup mode in logging
This commit is contained in:
MassimilianoPinto
2015-12-01 16:16:14 +01:00
committed by Johan Wikman
parent 943bcf1fe9
commit 3f31f5548d
2 changed files with 48 additions and 0 deletions

View File

@ -1562,6 +1562,7 @@ GWBUF *pkt;
uint8_t *buf;
ROUTER_SLAVE *slave, *nextslave;
int action;
unsigned int cstate;
spinlock_acquire(&router->lock);
slave = router->slaves;
@ -1716,9 +1717,19 @@ int action;
case SLAVE_FORCE_CATCHUP:
spinlock_acquire(&slave->catch_lock);
cstate = slave->cstate;
slave->cstate &= ~(CS_UPTODATE|CS_BUSY);
slave->cstate |= CS_EXPECTCB;
spinlock_release(&slave->catch_lock);
if ((cstate & CS_UPTODATE) == CS_UPTODATE)
{
MXS_NOTICE("%s: Slave %s:%d, server-id %d transition from up to date to catch-up in blr_distribute_binlog_record, binlog file '%s', position %lu.",
router->service->name,
slave->dcb->remote,
ntohs((slave->dcb->ipv4).sin_port),
slave->serverid,
slave->binlogfile, (unsigned long)slave->binlog_pos);
}
poll_fake_write_event(slave->dcb);
break;
}