The master and slave bits were previously set in more then one place.
This spread out the handling of those status bits and now all replication
related bits are set in one place.
If galeramon isn't able to connect to a Galera node, the server state is left
unaltered. This will cause servers that lose connectivity to be in RUNNING|JOINED
state which causes them to be assigned with the SLAVE status. For servers that are
never accessible, the state will be RUNNING.
Since there is but one log file where error, warning, notice, info
and debug messages are written, calling it "error.log" is misleading.
Consequently the log file is renamed to "maxscale.log".
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.