Pre-load users for all threads

Pre-loading users for all threads at startup significantly reduces the
chance for failures caused by the lazy initialization of the user database
done by the authenticators.

If users are not loaded at startup and the connection limit for all
servers is reached, authentication in MaxScale will fail not due to too
many connections but due to the lack of authentication data. This causes
repeated reloading of users, which floods the log with messages, and
unnecessary stress on the cluster itself.
This commit is contained in:
Markus Mäkelä
2017-12-22 09:29:44 +02:00
parent ad57de6784
commit fb1875c61c
3 changed files with 29 additions and 3 deletions

View File

@ -34,6 +34,7 @@
#include "internal/dcb.h"
#include "internal/modules.h"
#include "internal/poll.h"
#include "internal/service.h"
#include "internal/statistics.h"
#include "internal/workertask.hh"
@ -857,11 +858,11 @@ void Worker::delete_zombies()
void Worker::run()
{
if (modules_thread_init())
this_thread.current_worker_id = m_id;
if (modules_thread_init() && service_thread_init())
{
this_thread.current_worker_id = m_id;
poll_waitevents();
this_thread.current_worker_id = WORKER_ABSENT_ID;
MXS_NOTICE("Worker %d has shut down.", m_id);
modules_thread_finish();
@ -870,6 +871,8 @@ void Worker::run()
{
MXS_ERROR("Could not perform thread initialization for all modules. Thread exits.");
}
this_thread.current_worker_id = WORKER_ABSENT_ID;
}
bool Worker::start(size_t stack_size)