Log proper message in errorReply when master state is BLRM_SLAVE_STOPPED
Log proper message in errorReply when master state is BLRM_SLAVE_STOPPED
This commit is contained in:
@ -2382,10 +2382,10 @@ errorReply(MXS_ROUTER *instance,
|
|||||||
|
|
||||||
if (action == ERRACT_REPLY_CLIENT)
|
if (action == ERRACT_REPLY_CLIENT)
|
||||||
{
|
{
|
||||||
/** Check router state and set errno an message */
|
/** Check router state and set errno and message */
|
||||||
if (router->master_state < BLRM_BINLOGDUMP || router->master_state != BLRM_SLAVE_STOPPED)
|
if (router->master_state != BLRM_SLAVE_STOPPED)
|
||||||
{
|
{
|
||||||
/* Authentication failed */
|
/* Authentication failed: stop replication */
|
||||||
if (router->master_state == BLRM_TIMESTAMP)
|
if (router->master_state == BLRM_TIMESTAMP)
|
||||||
{
|
{
|
||||||
spinlock_acquire(&router->lock);
|
spinlock_acquire(&router->lock);
|
||||||
@ -2406,7 +2406,7 @@ errorReply(MXS_ROUTER *instance,
|
|||||||
dcb_close(backend_dcb);
|
dcb_close(backend_dcb);
|
||||||
|
|
||||||
MXS_ERROR("%s: Master connection error %lu '%s' in state '%s', "
|
MXS_ERROR("%s: Master connection error %lu '%s' in state '%s', "
|
||||||
"%s while connecting to master [%s]:%d",
|
"%s while connecting to master [%s]:%d. Replication is stopped.",
|
||||||
router->service->name, router->m_errno, router->m_errmsg,
|
router->service->name, router->m_errno, router->m_errmsg,
|
||||||
blrm_states[BLRM_TIMESTAMP], msg,
|
blrm_states[BLRM_TIMESTAMP], msg,
|
||||||
router->service->dbref->server->name,
|
router->service->dbref->server->name,
|
||||||
@ -2427,14 +2427,15 @@ errorReply(MXS_ROUTER *instance,
|
|||||||
getsockopt(router->master->fd, SOL_SOCKET, SO_ERROR, &error, &len) == 0 &&
|
getsockopt(router->master->fd, SOL_SOCKET, SO_ERROR, &error, &len) == 0 &&
|
||||||
error != 0)
|
error != 0)
|
||||||
{
|
{
|
||||||
sprintf(msg, "%s ", mxs_strerror(error));
|
sprintf(msg, "%s, ", mxs_strerror(error));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy(msg, "");
|
strcpy(msg, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (router->master_state < BLRM_BINLOGDUMP || router->master_state != BLRM_SLAVE_STOPPED)
|
/** Check router state and set errno and message */
|
||||||
|
if (router->master_state != BLRM_SLAVE_STOPPED)
|
||||||
{
|
{
|
||||||
spinlock_acquire(&router->lock);
|
spinlock_acquire(&router->lock);
|
||||||
/* set mysql_errno */
|
/* set mysql_errno */
|
||||||
@ -2449,7 +2450,7 @@ errorReply(MXS_ROUTER *instance,
|
|||||||
spinlock_release(&router->lock);
|
spinlock_release(&router->lock);
|
||||||
|
|
||||||
MXS_ERROR("%s: Master connection error %lu '%s' in state '%s', "
|
MXS_ERROR("%s: Master connection error %lu '%s' in state '%s', "
|
||||||
"%s attempting reconnect to master [%s]:%d",
|
"%sattempting reconnect to master [%s]:%d",
|
||||||
router->service->name, mysql_errno, errmsg,
|
router->service->name, mysql_errno, errmsg,
|
||||||
blrm_states[router->master_state], msg,
|
blrm_states[router->master_state], msg,
|
||||||
router->service->dbref->server->name,
|
router->service->dbref->server->name,
|
||||||
@ -2457,10 +2458,10 @@ errorReply(MXS_ROUTER *instance,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MXS_ERROR("%s: Master connection error %lu '%s' in state '%s', "
|
/* Stopped state, no reconnection */
|
||||||
"%s attempting reconnect to master [%s]:%d",
|
MXS_INFO("%s: Master connection has been closed. State is '%s', "
|
||||||
router->service->name, router->m_errno,
|
"%snot retrying a new connection to master [%s]:%d",
|
||||||
router->m_errmsg ? router->m_errmsg : "(memory failure)",
|
router->service->name,
|
||||||
blrm_states[router->master_state], msg,
|
blrm_states[router->master_state], msg,
|
||||||
router->service->dbref->server->name,
|
router->service->dbref->server->name,
|
||||||
router->service->dbref->server->port);
|
router->service->dbref->server->port);
|
||||||
|
Reference in New Issue
Block a user