Merge commit 'a60bd376108f71fccf40001c1496f32c11137fe4' into develop
This commit is contained in:
@ -3731,8 +3731,10 @@ void config_add_defaults(CONFIG_CONTEXT* ctx, const MXS_MODULE_PARAM* params)
|
||||
{
|
||||
if (params[i].default_value && !ctx->m_parameters.contains(params[i].name))
|
||||
{
|
||||
bool rv = config_add_param(ctx, params[i].name, params[i].default_value);
|
||||
MXS_ABORT_IF_FALSE(rv);
|
||||
std::string key = params[i].name;
|
||||
std::string value = params[i].default_value;
|
||||
config_fix_param(params, key, &value);
|
||||
ctx->m_parameters.set(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1015,6 +1015,18 @@ void MariaDBMonitor::wait_cluster_stabilization(GeneralOpData& op, const ServerA
|
||||
"connect to '%s' within the time limit.";
|
||||
MXS_WARNING(MSG, fails, new_master->name(), repl_fails.size(), query_fails.size(),
|
||||
unconfirmed.size(), new_master->name());
|
||||
|
||||
// If any of the unconfirmed slaves have error messages in their slave status, print them. They
|
||||
// may explain what went wrong.
|
||||
for (auto failed_slave : unconfirmed)
|
||||
{
|
||||
auto slave_conn = failed_slave->slave_connection_status_host_port(new_master);
|
||||
if (slave_conn && !slave_conn->last_error.empty())
|
||||
{
|
||||
MXB_WARNING("%s did not connect because of error: '%s'",
|
||||
slave_conn->to_short_string().c_str(), slave_conn->last_error.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
time_remaining -= timer.lap();
|
||||
}
|
||||
|
||||
@ -1151,34 +1151,23 @@ bool RWSplitSession::handle_error_new_connection(DCB* backend_dcb, GWBUF* errmsg
|
||||
mxb_assert(m_expected_responses > 0);
|
||||
m_expected_responses--;
|
||||
|
||||
/**
|
||||
* A query was sent through the backend and it is waiting for a reply.
|
||||
* Try to reroute the statement to a working server or send an error
|
||||
* to the client.
|
||||
*/
|
||||
GWBUF* stored = m_current_query.release();
|
||||
// Route stored queries if this was the last server we expected a response from
|
||||
route_stored = m_expected_responses == 0;
|
||||
|
||||
if (stored && m_config.retry_failed_reads)
|
||||
if (!backend->has_session_commands())
|
||||
{
|
||||
mxb_assert(m_expected_responses == 0);
|
||||
MXS_INFO("Re-routing failed read after server '%s' failed", backend->name());
|
||||
retry_query(stored, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
gwbuf_free(stored);
|
||||
|
||||
if (!backend->has_session_commands())
|
||||
// The backend was busy executing command and the client is expecting a response.
|
||||
if (m_current_query.get() && m_config.retry_failed_reads)
|
||||
{
|
||||
/** The backend was not executing a session command so the client
|
||||
* is expecting a response. Send an error so they know to proceed. */
|
||||
m_client->func.write(m_client, gwbuf_clone(errmsg));
|
||||
MXS_INFO("Re-routing failed read after server '%s' failed", backend->name());
|
||||
route_stored = false;
|
||||
retry_query(m_current_query.release(), 0);
|
||||
}
|
||||
|
||||
if (m_expected_responses == 0)
|
||||
else
|
||||
{
|
||||
// This was the last response, try to route pending queries
|
||||
route_stored = true;
|
||||
// Send an error so that the client knows to proceed.
|
||||
m_client->func.write(m_client, gwbuf_clone(errmsg));
|
||||
m_current_query.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user