MXS-2011 Log complaint from master
If the replication is terminated, the error message sent by the master is written to the log.
This commit is contained in:
@ -1787,6 +1787,7 @@ static void blr_terminate_master_replication(ROUTER_INSTANCE* router,
|
|||||||
memcpy(msg_err, (char *)ptr + err_msg_offset, msg_len);
|
memcpy(msg_err, (char *)ptr + err_msg_offset, msg_len);
|
||||||
*(msg_err + msg_len) = '\0';
|
*(msg_err + msg_len) = '\0';
|
||||||
|
|
||||||
|
std::string s(msg_err);
|
||||||
spinlock_acquire(&router->lock);
|
spinlock_acquire(&router->lock);
|
||||||
|
|
||||||
char* old_errmsg = router->m_errmsg;
|
char* old_errmsg = router->m_errmsg;
|
||||||
@ -1798,8 +1799,10 @@ static void blr_terminate_master_replication(ROUTER_INSTANCE* router,
|
|||||||
spinlock_release(&router->lock);
|
spinlock_release(&router->lock);
|
||||||
|
|
||||||
MXS_FREE(old_errmsg);
|
MXS_FREE(old_errmsg);
|
||||||
MXS_ERROR("Error packet in binlog stream.%s @ %lu.",
|
// TODO: Would it or would it not be safe to access router->m_errmsg here?
|
||||||
router->binlog_name, router->current_pos);
|
// TODO: Is the locking above really needed?
|
||||||
|
MXS_ERROR("Error packet in binlog stream (%s@%lu): %s",
|
||||||
|
router->binlog_name, router->current_pos, s.c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user