Switched to ExternalProject CMake module to make the inclusion of external CMake
projects easier. This removes the rebuilding of the pcre2 libraries each time
the project is reconfigured.
The soname version numbers were missing from all the library targets
properties which caused ldconfig to warn about non-symlink libraries
being installed.
Earlier, by default, the error and message logfiles were written to
the filesystem and trace and debug logfiles to shared memory. Now,
with just one log-file the default must be the file-system. However,
if info and debug messages are logged, then the filesystem will
become a bottle-neck.
A reasonable approach is then as follows (in the config file)
syslog=true
maxlog=false
log_to_shm=true
With this set, the maxlog file will be created to shared memory, but
nothing will be written to it, since it is disabled. However, if there
is a need to investigate something, then a dba can from maxadmin turn
on maxlog logging and also enable info and debug messages. That is, it
will be possible to enable debugging output without restarting maxscale.
Incidentally, the way the config file and command line arguments are
handled should be rewritten. Currently, it is a mess.
There were some variance regarding the way the MaxScale log (i.e.
the file log) was called; "maxlog" in configuration file and
"maxscalelog" at the command line and maxadmin interface. Now it
is uniformly referred to as "maxlog" in the configuration file, at
the command line, from maxadmin and in the code.
It should not be possible to disable the error priority as error
messages should always be logged.
In addition some minor corrections of command line texts.
The 0.6.0 version of librabbitmq-c added two parameters to amqp_exchange_declare
which allow auto-deleted and internal exchanges. This change requires more
advanced version detection so that code could be conditionally compiled for
newer versions of the library.
modutil_get_complete_packets was assuming that at least 3 bytes of each packet
is available. This results in an out-of-bounds read if less than 3 bytes of data
for a partial result set is available.
In blr_open_binlog the refcnt increase of file which is already
open is protected by router->fileslock. In blr_close_binlog the
decrease of the refcnt was protected by file->lock.
This lead to a situation where it was possible that a file was
closed and the file instance freed, even though it just had been
taken into use by somebody else.
This is now fixed by solely using the router->fileslock for protecting
the increase and decrease of the refcnt.
The limit_queries parsing used a bad initial value for the return value
which lead to a guaranteed failure. Other parts of the code used wrong values
for comparisons leading to sporadic parsing errors.
The mqfilter was not built by default even though it should have been. This has
been fixed but the filter is built only if librabbitmq is found. This was done
to avoid having the librabbitmq and its development headers as a hard
dependency.
The fact that the maxscale process exits only after all services have been
started means that systemd will kill the maxscale process if starting the
services takes too long. Since the user authentication data is loaded on
startup and can take up a long time, there needs to be a longer than
default timeout for systems that use systemd.
If individual servers had a weightby parameter value greater than INT_MAX * 1000
the integer used for calculation would overflow and the server would end up
having a negative weight. This would cause all connections to pile up on this
server.
The same overflow was possible for the sum of all the weightby parameter values
even if no single parameter exceeded the limit.
A large part of parse_query was parsing of the actual rule definitions. This made
the function very large and hard to understand. For this reason the definition parsing
was moved to its own function.
The earlier log file based approach for enabling and disabling
messages has now been completely replaced with the syslog priority
based approach.
Similarly as with log files before it is now possible to enable
and disable a log priority for a particular session, even though
it apparently has not been used much.
The local test-programs of the logging has got minimal attention
only to make them compile. They should get an overhaul as they did
not work before either.
Maxadmin earlier gave the impression that you could change whether
messages for different log files could be specifically enabled for
a session. In practice that was true only for trace messages as the
session id and the bitmask telling what logfiles are enabled, were
copied to thread local storage only as far as trace messages were
concered.
The code for setting that information in place is quit short and
efficient, so there is really no reason not to do that always.
This also means that it always will be possible to get your hands
on the session object if there is a need for that.
The code used in the query classifier was not compatible with 10.1 version
of MariaDB and needed to be fine tuned in order for it to work with all
supported versions of MariaDB.
In blr_slave.c under certain conditions, two locks were not released.
That was fixed in another change, and with this change a notice will be
logged if that branch is entered. That way it will be possible to find
out whether this may have been the cause of earlier lock-ups.
In blr_slave.c under certain conditions, two locks were not released.
That was fixed in another change, and with this change a notice will be
logged if that branch is entered. That way it will be possible to find
out whether this may have been the cause of earlier lock-ups.
The regular expression used when cleaning multiline configuration parameters
didn't match trailing backslash characters in pathnames. This caused them to be
added to the next line causing a possible error.