MXS-2559: Log source of loaded users

MySQLAuth now logs the server where the users were loaded from. As only
the initial loading of users causes a log message, it is still possible
for the source server to change without any indication of it.
This commit is contained in:
Markus Mäkelä
2019-07-10 08:55:16 +03:00
parent 3649efde0b
commit f139991a2c
3 changed files with 12 additions and 7 deletions

View File

@ -787,7 +787,8 @@ static int mysql_auth_load_users(SERV_LISTENER* port)
first_load = true;
}
int loaded = replace_mysql_users(port, first_load);
SERVER* srv = nullptr;
int loaded = replace_mysql_users(port, first_load, &srv);
bool injected = false;
if (loaded <= 0)
@ -834,7 +835,9 @@ static int mysql_auth_load_users(SERV_LISTENER* port)
}
else if (loaded > 0 && first_load)
{
MXS_NOTICE("[%s] Loaded %d MySQL users for listener %s.", service->name, loaded, port->name);
mxb_assert(srv);
MXS_NOTICE("[%s] Loaded %d MySQL users for listener %s from server %s.",
service->name, loaded, port->name, srv->name);
}
return rc;