Event notification to slaves: code review
Event notification to slaves: code review update
This commit is contained in:
@ -111,7 +111,7 @@ extern bool blr_notify_waiting_slave(ROUTER_SLAVE *slave);
|
|||||||
|
|
||||||
static int keepalive = 1;
|
static int keepalive = 1;
|
||||||
|
|
||||||
/** Transactio-Safety feature */
|
/** Transaction-Safety feature */
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
BLRM_NO_TRANSACTION, /*< No transaction */
|
BLRM_NO_TRANSACTION, /*< No transaction */
|
||||||
@ -2733,29 +2733,24 @@ void blr_notify_all_slaves(ROUTER_INSTANCE *router)
|
|||||||
{
|
{
|
||||||
ROUTER_SLAVE *slave;
|
ROUTER_SLAVE *slave;
|
||||||
int notified = 0;
|
int notified = 0;
|
||||||
|
|
||||||
spinlock_acquire(&router->lock);
|
spinlock_acquire(&router->lock);
|
||||||
slave = router->slaves;
|
slave = router->slaves;
|
||||||
while (slave)
|
while (slave)
|
||||||
{
|
{
|
||||||
if (slave->state != BLRS_DUMPING)
|
|
||||||
{
|
|
||||||
slave = slave->next;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Notify a slave that has CS_WAIT_DATA bit set */
|
/* Notify a slave that has CS_WAIT_DATA bit set */
|
||||||
if (blr_notify_waiting_slave(slave))
|
if (slave->state == BLRS_DUMPING &&
|
||||||
|
blr_notify_waiting_slave(slave))
|
||||||
{
|
{
|
||||||
notified++;
|
notified++;
|
||||||
}
|
}
|
||||||
|
|
||||||
slave = slave->next;
|
slave = slave->next;
|
||||||
}
|
}
|
||||||
spinlock_release(&router->lock);
|
spinlock_release(&router->lock);
|
||||||
|
|
||||||
if (notified > 0)
|
if (notified > 0)
|
||||||
{
|
{
|
||||||
MXS_BEBUG("Notified %d slaves about new data.", notified);
|
MXS_DEBUG("Notified %d slaves about new data.", notified);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user