MXS-1167: Skip loading of users for internal services at startup

When MaxScale is being started and the users are loaded, the MySQL
authenticator should not load the database users for internal services
abstracted as servers.

The loading of users at startup for internal services is avoided because
the startup is done in a single thread context and the internal services
have not yet been started.

The delayed loading of users will cause the authentication to fail when
the first client connect. This triggers the reloading of the users and the
second attempt at authentication will succeed. All of this is hidden from
the end user.
This commit is contained in:
Markus Mäkelä
2017-03-20 12:16:29 +02:00
parent 0b5d164855
commit ab4c738c3c
3 changed files with 18 additions and 8 deletions

View File

@ -171,11 +171,12 @@ bool dbusers_save(sqlite3 *src, const char *filename);
/**
* Reload and replace the currently loaded database users
*
* @param service The current service
* @param service The current service
* @param skip_local Skip loading of users on local MaxScale services
*
* @return -1 on any error or the number of users inserted (0 means no users at all)
*/
int replace_mysql_users(SERV_LISTENER *listener);
int replace_mysql_users(SERV_LISTENER *listener, bool skip_local);
/**
* @brief Verify the user has access to the database