When a slave server fails to execute a session command, the log message printed
the command that was being executed as if the ERR packet was a COM_QUERY packet.
This caused corrupt strings to be printed into the error logs.
In blr_slave_callback the bits of slave->cstate are reset and
set as one transaction. Earlier they were reset in one and
set in another, leading to a situation where slave->cstate did
not contain a sensible value for a short period of time.
Further, it is now explicitly checked in blr_distribute_binlog_record
that slave->cstate indeed contains a meaningful value.
A debug assertion in the readwritesplit would always fail when the master DCB
was NULL. This was caused by the fact that the debug assertion assumes that the
pointer that is passed to it is a valid pointer.
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.
Currently not used, but the existing query_classifier will be
changed into being just a wrapper around a dynamically loaded
query classifier plugin, i.e. qc_mysqlembedded.
Added a query classifier plugin interface using which plugins
export their functionality. Cleaned up header slightly as well.
This is the first step in the process of making the loading of
the query classifier truly dynamic.
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.
The master DCB was used without checking if it was still open. It was possible
that the master DCB was closed and processed before the client had fully
processed all queries which caused it to fail at a debug assertion.
The fix to this is to use the client's DCB to get access to the shared session
authentication data as it is protected by additional locks.
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().
Platform.h is intended to contain definitions and workarounds
for concepts that depend upon the used compiler and/or platform.
Currently it ensures that /thread_local/ is available irrespective
of whether the source is compiled in pre- or post C11 or C++11 mode.
This file should be included first by all MaxScale headers.
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 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 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.