MXS-2794: Log changes in loaded users

By checking whether the users have changed whenever they are reloaded, we
improve the visibility of the user reloading process. Using a checksum
allows us to easily compress the information with acceptable loss of
accuracy. Using a CAS loop prevents duplicate messages without losing any
updates even if multiple user reloads result in different outcomes.
This commit is contained in:
Markus Mäkelä
2019-12-10 08:40:07 +02:00
parent e36c7efa25
commit cb4e43b05a
3 changed files with 40 additions and 6 deletions

View File

@ -192,6 +192,7 @@ static void* mysql_auth_init(char** options)
instance->skip_auth = false;
instance->check_permissions = true;
instance->lower_case_table_names = false;
instance->checksum = 0;
for (int i = 0; options[i]; i++)
{
@ -820,12 +821,6 @@ static int mysql_auth_load_users(Listener* port)
" will probably fail as a result.",
service->name());
}
else if (loaded > 0 && first_load)
{
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;
}