MXS-2446 Do not assume created server exists
"Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth." Arthur Conan Doyle Since server objects are never destroyed, currently the only explanation for the crash described in MXS-2446 is that a server created at runtime could not, immediately after the creation, be found using its name.
This commit is contained in:
@ -561,6 +561,8 @@ bool ClustrixMonitor::refresh_nodes(MYSQL* pHub_con)
|
||||
SERVER* pServer = SERVER::find_by_unique_name(server_name);
|
||||
mxb_assert(pServer);
|
||||
|
||||
if (pServer)
|
||||
{
|
||||
if (softfailed)
|
||||
{
|
||||
pServer->set_status(SERVER_DRAINING);
|
||||
@ -579,6 +581,13 @@ bool ClustrixMonitor::refresh_nodes(MYSQL* pHub_con)
|
||||
service_add_server(this, pServer);
|
||||
}
|
||||
else
|
||||
{
|
||||
MXS_ERROR("%s: Created server %s (at %s:%d) could not be "
|
||||
"looked up using its name.",
|
||||
name(), server_name.c_str(), ip.c_str(), mysql_port);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MXS_ERROR("%s: Could not create server %s at %s:%d.",
|
||||
name(), server_name.c_str(), ip.c_str(), mysql_port);
|
||||
|
||||
Reference in New Issue
Block a user