Merge branch '2.3' into 2.4
This commit is contained in:
commit
bd3107e7ca
@ -609,16 +609,9 @@ bool RWSplitSession::route_session_write(GWBUF* querybuf, uint8_t command, uint3
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string status;
|
||||
for (const auto& a : m_backends)
|
||||
{
|
||||
status += "\n";
|
||||
status += a->get_verbose_status();
|
||||
}
|
||||
|
||||
MXS_ERROR("Could not route session command: %s. Connection information: %s",
|
||||
MXS_ERROR("Could not route session command: %s. Connection status: %s",
|
||||
attempted_write ? "Write to all backends failed" : "All connections have failed",
|
||||
status.c_str());
|
||||
get_verbose_status().c_str());
|
||||
}
|
||||
|
||||
return nsucc;
|
||||
@ -669,8 +662,8 @@ RWBackend* RWSplitSession::get_master_backend()
|
||||
else
|
||||
{
|
||||
MXS_ERROR("Cannot choose server '%s' as the master because it is not "
|
||||
"in use and a new connection to it cannot be created.",
|
||||
master->name());
|
||||
"in use and a new connection to it cannot be created. Connection status: %s",
|
||||
master->name(), get_verbose_status().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1254,25 +1254,17 @@ bool RWSplitSession::handle_error_new_connection(DCB* backend_dcb, GWBUF* errmsg
|
||||
route_stored_query();
|
||||
}
|
||||
|
||||
bool succp = false;
|
||||
bool ok = can_recover_servers() || can_continue_session();
|
||||
|
||||
if (!can_recover_servers())
|
||||
if (!ok)
|
||||
{
|
||||
succp = can_continue_session();
|
||||
|
||||
if (!succp)
|
||||
{
|
||||
MXS_ERROR("Unable to continue session as all connections have failed, "
|
||||
"last server to fail was '%s'.", backend->name());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try to replace failed connections
|
||||
succp = open_connections();
|
||||
MXS_ERROR("Unable to continue session as all connections have failed and "
|
||||
"new connections cannot be created. Last server to fail was '%s'.",
|
||||
backend->name());
|
||||
MXS_INFO("Connection status: %s", get_verbose_status().c_str());
|
||||
}
|
||||
|
||||
return succp;
|
||||
return ok;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -262,6 +262,19 @@ private:
|
||||
});
|
||||
}
|
||||
|
||||
std::string get_verbose_status()
|
||||
{
|
||||
std::string status;
|
||||
|
||||
for (const auto& a : m_backends)
|
||||
{
|
||||
status += "\n";
|
||||
status += a->get_verbose_status();
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
inline bool is_large_query(GWBUF* buf)
|
||||
{
|
||||
uint32_t buflen = gwbuf_length(buf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user