When a module is unregistered, it must be removed from the list.
Otherwise, if explicit unregistering of a module is made, there
will be a crash at shutdown when all modules are unregistered.
Slist removed from skygw_utils and added as a separate component.
Nobody seems to be using it, so it could also simply be removed.
Left in place for the time being.
Shutting down monitors is not supposed to be done ofter so there is no true
benefit from keeping the connections open. With the refactoring of the monitor
interface, this can be done in a centralized place.
The FindMariaDBConnector.cmake file now checks if the found library actually is
the MariaDB Connector-C library. If the found library is not the MariaDB
Connector-C, it will be built from source.
The include directories previously used by MaxScale were from the embedded
library. All parts of MaxScale apart from the query classifier now use
the client libraries.
Since maxscale-common is linked to the connector-c library
and no longer to the MySql embedded library, mysql_library_init
does not need any parameters.
There can be any sort of library behind qc_init. Hence the arguments
cannot be hardwired to be like the embedded library wants them.
Eventually it might make sense to allow passing arguments from
maxscale.cnf.
Now, qc_mysqlembedded is linked against MySQL's embedded library,
and MaxScale itself against Connector-C.
So, in order to build MaxScale, Connector-C must be installed.
This has been tested with Connector-C 2.2.1.
The build variable MYSQLCLIENT_LIBRARIES is no longer used.
The query_classifier library is now only a wrapper that loads an
actual query classifier implementation. Currently it is hardwired
to load qc_mysqlembedded, which implements the query classifier
API using MySQL embedded.
This will be changed, so that the library to load is specified
when qc_init() is called. That will then allow the query classifier
to be specified in the config file.
Currently there seems to be a conflict between the mysql_library_end()
call made in qc_mysqlembedded and the mysql_library_end() call made in
gateway.c. The reason is that they both finalize a shared library.
For the time being mysql_library_end() is not called in gateway.c.
This problem is likely to go away by switching from the client
library to the connector-c library.
Now, qc_mysqlembedded is linked against MySQL's embedded library,
and MaxScale itself against Connector-C.
So, in order to build MaxScale, Connector-C must be installed.
This has been tested with Connector-C 2.2.1.
The build variable MYSQLCLIENT_LIBRARIES is no longer used.
The query_classifier library is now only a wrapper that loads an
actual query classifier implementation. Currently it is hardwired
to load qc_mysqlembedded, which implements the query classifier
API using MySQL embedded.
This will be changed, so that the library to load is specified
when qc_init() is called. That will then allow the query classifier
to be specified in the config file.
Currently there seems to be a conflict between the mysql_library_end()
call made in qc_mysqlembedded and the mysql_library_end() call made in
gateway.c. The reason is that they both finalize a shared library.
For the time being mysql_library_end() is not called in gateway.c.
This problem is likely to go away by switching from the client
library to the connector-c library.
Earlier the same (or almost the same) code was duplicated in
several places.
A conflicting declaration was also removed. There was no
implementation for that declaration.
The polling statistics collection used atomic_add to increment values. This
is not an optimal way to update statistical values. Moved to per thread
values which are summed up when they are read.
Moved the functions used to gather polling statistics to their own file and
created a specific data type for statistics.
The THREAD type was not used everywhere and pthread_t was used instead.
The thread creation function also returned the address of a stack allocated
value which isn't guaranteed to be usable.
Only the query classifier needs the functionality of the embedded
server, while the rest of MaxScale is content with the client
library or Connector/C.
This have now been rearranged so that query-classifier links with
the embedded static library and then explicitly exports its own
functions using the query_classifier.map linker script. That way
query classifier will use the embedded library, while the rest of
maxscale use the client library, and this without conflicts.
Currently, query_classifier is not linked to maxscale-common,
but executables must link to maxscale-common and query_classifier.
Earlier thread initialization was done in poll_waitevents(),
which was somewhat confusing, since the main thread also calls
into poll_waitevents().
Now there is a specific thread "main" function, which first
performs thread specific initialization and then calls into
poll_waitevents().
This is the first change in an attempt to arrange the linking so that
more errors are detected at link-time.
- All files in server/core but for gateway.c are linked to one shared
library called maxscale-common.
- The files log_manager/log_manager.cc and utils/skygw_utils.cc are
built into maxscale-common as well.
- MaxScale itself consists now only of gateway.c and is linked with
maxscale-common.
- All plugins link with maxscale-common.
- All executables link in addition with {EMBEDDED_LIB}.
After this change, the change (MXS-517) where query_classifier is the
only component that uses ${EMBEDDED_LIB} and the rest mysqlclient can
be made much cleaner.
After a few additional steps, all shared libraries can be linked with
the linker flags "-Wl,-z,defs", which directs the linker to resolve
all symbols. That will require that all shared libraries list all the
libraries they need, but will at the same time ensure that any
missing symbols are detected at link-time and not at run-time.
The manpage was out of date and was missing a BUGS section. The `--help` output
of MaxScale wrongly stated that the default is to log to shared memory as did
the documentation.
The current implementation of the session timeout functionality is not safe to
use. Added a warning to the documentation and disabled the code. If the user
tries to use it, a warning is logged.
The current implementation of idle connection timeouts is not safe. The sessions
are handled in a way which is not thread-safe and the checking is done from
a non-polling thread.
With this change, the checks for the session timeouts are done in one of the
polling threads in a thread-safe manner only if at least one service has enabled
the timing out of idle client connections.