Add more information to rwsplit info messages
The statement ID for all binary protocol statements and the error given to handleError are now logged.
This commit is contained in:
@ -638,11 +638,19 @@ void QueryClassifier::log_transaction_status(GWBUF* querybuf, uint32_t qtype)
|
|||||||
uint8_t* packet = GWBUF_DATA(querybuf);
|
uint8_t* packet = GWBUF_DATA(querybuf);
|
||||||
unsigned char command = packet[4];
|
unsigned char command = packet[4];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
char* sql;
|
std::string sqldata;
|
||||||
|
char* sql = (char*)"<non-SQL>";
|
||||||
char* qtypestr = qc_typemask_to_string(qtype);
|
char* qtypestr = qc_typemask_to_string(qtype);
|
||||||
if (!modutil_extract_SQL(querybuf, &sql, &len))
|
|
||||||
|
if (qc_mysql_is_ps_command(command))
|
||||||
{
|
{
|
||||||
sql = (char*)"<non-SQL>";
|
sqldata = "ID: " + std::to_string(mysql_extract_ps_id(querybuf));
|
||||||
|
sql = (char*)sqldata.c_str();
|
||||||
|
len = sqldata.length();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
modutil_extract_SQL(querybuf, &sql, &len);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len > QC_TRACE_MSG_LEN)
|
if (len > QC_TRACE_MSG_LEN)
|
||||||
|
@ -956,7 +956,7 @@ void RWSplitSession::handleError(GWBUF* errmsgbuf,
|
|||||||
|
|
||||||
if (m_current_master && m_current_master->in_use() && m_current_master == backend)
|
if (m_current_master && m_current_master->in_use() && m_current_master == backend)
|
||||||
{
|
{
|
||||||
MXS_INFO("Master '%s' failed", backend->name());
|
MXS_INFO("Master '%s' failed: %s", backend->name(), extract_error(errmsgbuf).c_str());
|
||||||
/** The connection to the master has failed */
|
/** The connection to the master has failed */
|
||||||
|
|
||||||
if (!backend->is_waiting_result())
|
if (!backend->is_waiting_result())
|
||||||
@ -1028,7 +1028,7 @@ void RWSplitSession::handleError(GWBUF* errmsgbuf,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MXS_INFO("Slave '%s' failed", backend->name());
|
MXS_INFO("Slave '%s' failed: %s", backend->name(), extract_error(errmsgbuf).c_str());
|
||||||
if (m_target_node && m_target_node == backend
|
if (m_target_node && m_target_node == backend
|
||||||
&& session_trx_is_read_only(problem_dcb->session))
|
&& session_trx_is_read_only(problem_dcb->session))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user