4458 Commits

Author SHA1 Message Date
Johan Wikman
6f737d9484 Reindent server/core/atomic.c 2015-11-30 10:56:38 +02:00
Markus Makela
d15508d2d4 Updated rabbitmq-consumer build process
Updated the CMake files to use proper install locations and removed
unused spec file.
2015-11-30 10:46:24 +02:00
Markus Makela
ce20c638fc Cleaned up PCRE2 build process
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.
2015-11-30 10:46:08 +02:00
Markus Makela
3cd648fa09 Fixed telnetd soname
The telnetd was missing the VERSION target property which activates the
soname generation for CMake.
2015-11-30 10:46:08 +02:00
Markus Makela
a829b38873 Fix to MXS-363: Added soname versions to libraries
The soname version numbers were missing from all the library targets
properties which caused ldconfig to warn about non-symlink libraries
being installed.
2015-11-30 10:46:08 +02:00
MassimilianoPinto
dcf81db395 Merge branch '1.2.1-binlog_router_trx' into develop 2015-11-30 09:40:04 +01:00
Johan Wikman
5fa3ef8236 Allow logging to shared memory to be enabled in config file.
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.
2015-11-29 21:03:05 +02:00
Johan Wikman
384029c109 MaxScale log called consistently for maxlog
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.
2015-11-27 16:10:37 +02:00
Johan Wikman
2feb2ed3a2 Prevent disabling error log priority.
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.
2015-11-27 16:09:57 +02:00
Johan Wikman
2bfcf7e88a Enable LOG_WARNING by default.
In addition the error and notice messages, also warning messages
are enabled by default.
2015-11-27 16:08:49 +02:00
Markus Makela
230978f6db Added missing logging to externcmd.c
Not all failures caused an error to be logged.
2015-11-27 12:32:27 +02:00
Markus Makela
573af3c4c1 Removed 1.2.0 installation warnings
The message printed when MaxScale is installed from a package is no longer
necessary for 1.3.0.
2015-11-27 12:23:07 +02:00
Markus Makela
f441f72b75 Added support for librabbitmq-c 0.6.0 and newer
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.
2015-11-27 12:21:19 +02:00
Markus Makela
9e25ed4b67 Removed unnecessary installation of tests
The maxadmin tests were installed even though they do not require any
configuring to work.
2015-11-27 12:21:19 +02:00
MassimilianoPinto
14d11fa4c0 Changed name for bad fd
Changed name for bad fd
2015-11-27 09:43:58 +01:00
MassimilianoPinto
5a64fc70dc Log messages fix with slave ip:port and id
Log messages fix with slave ip:port and id
2015-11-27 09:16:17 +01:00
MassimilianoPinto
dd922a1ff9 Added check for missing service listener
Added check for missing service listener
2015-11-26 17:00:30 +01:00
Johan Wikman
916ee5ff2a Rename some log concepts
The mxs prefix is now uniformly used with all log components.
2015-11-26 17:34:53 +02:00
Markus Makela
6ab9b4ca67 Removed whitespace and fixed headings
The RabbitMQ-Setup-And-MaxScale-Integration.md document had trailing whitespace
and used the wrong number in a heading.
2015-11-26 16:31:11 +02:00
Markus Makela
b67232a4fa Fixed out-of-bounds reads of packet length
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.
2015-11-26 13:33:49 +02:00
Johan Wikman
e38334c457 Fix locking issue in blr_close_binlog
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.
2015-11-26 10:34:34 +02:00
Markus Makela
63da12e5b5 Corrected bugs introduced by refactoring of the dbfwfilter
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.
2015-11-26 09:59:39 +02:00
Markus Makela
443bbe73d2 Mqfilter is built if possible
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.
2015-11-26 09:28:27 +02:00
Markus Makela
6ea209d13a Added a timeout for the systemd script
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.
2015-11-26 09:28:04 +02:00
Markus Makela
8ae187622c Fixed weightby overflow being silently ignored in readwritesplit
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.
2015-11-25 22:43:46 +02:00
Markus Makela
b0458b3cc4 Fixed wrong value being used for users rules in dbfwfilter
A parsed, local copy of the string was duplicated instead of the original string
which caused the parsing to always fail.
2015-11-25 17:39:18 +02:00
Markus Makela
038877b8db Fixed minor format errors and resource leaks
Some format strings used integer values for unsigned integers.
Memory and file descriptors leaked in some error conditions.
2015-11-25 12:43:49 +02:00
counterpoint
dcf0d4ef4b Merge remote-tracking branch 'origin/MXS-472a' into develop 2015-11-25 10:42:52 +00:00
MassimilianoPinto
5353353a3a Merge '1.2.1-binlog_router_trx' into develop 2015-11-25 10:53:55 +01:00
Johan Wikman
01f2aa8d1b All but LOG_INFO and LOG_DEBUG are logged to syslog.
*If* syslog logging is enabled, then all messages but LOG_INFO
and LOG_DEBUG are logged to syslog.
2015-11-25 09:24:48 +02:00
Johan Wikman
af6ec7f346 Allow [en|dis]abling of [sys|maxscale]log via maxadmin.
The syslog and maxscalelog can now be enabled and disabled at
runtime using maxadmin.
2015-11-25 09:16:17 +02:00
Markus Makela
51e41bb2e3 Updated binlog router tutorial
Renamed all occurences of replication proxy with Binlog Server.
2015-11-24 20:49:47 +02:00
Markus Makela
59b0555090 Made function parameters const where possible.
Some of the functions for dbfwfilter were taking char* arguments where
const char* was more appropriate.
2015-11-24 13:54:50 +02:00
Markus Makela
cbc1872b2b Refactoring of dbfwfilter limit_queries parsing
Moved parsing of limit_queries into a separate function.
2015-11-24 13:54:50 +02:00
Markus Makela
76dc63efa2 Moved rule definition parsing to its own function
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.
2015-11-24 13:54:50 +02:00
Markus Makela
62ca9ab8ec Moved parsing of at_times rules to a separate function
This was done in order to make the parse_rule function smaller and easier to
comprehend.
2015-11-24 13:54:28 +02:00
counterpoint
34f045ca75 Merge remote-tracking branch 'origin/develop' into MXS-472a 2015-11-24 10:19:18 +00:00
counterpoint
1af89298b9 Changes to Galera monitoring logic and tidying up following code review. 2015-11-24 10:08:07 +00:00
Johan Wikman
a8535f42af Remove all traces of logfile_t
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.
2015-11-23 19:10:53 +02:00
Johan Wikman
910ddb99fd Reset sessionid upon exit.
Since the sessionid is now unconditionally set, it also needs to
be unconditionally reset.
2015-11-23 18:44:38 +02:00
Markus Makela
c6982b863a Added missing initialization of values
A call to localtime_r was done with an uninitialized time_t value.
2015-11-23 18:33:59 +02:00
Johan Wikman
62b0e5fab0 Session info always copied to tls
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.
2015-11-23 18:14:46 +02:00
Markus Makela
d7e685e2fe Increased version number.
MaxScale version number set to 1.3.0-1.
2015-11-23 13:06:39 +02:00
counterpoint
68a7f4b472 Merge remote-tracking branch 'origin/develop' into MXS-472a 2015-11-23 10:05:55 +00:00
Markus Makela
23b2ce004b Added support for MariaDB 10.1 embedded library
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.
2015-11-23 11:41:05 +02:00
Johan Wikman
c167499c7b Add notice about previous failure to unlock.
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.
2015-11-23 09:51:59 +02:00
Johan Wikman
1b9920ef10 Add notice about previous failure to unlock.
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.
2015-11-23 09:25:50 +02:00
Markus Makela
37f8374a10 Fixed multiline configuration processing
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.
2015-11-21 15:21:23 +02:00
Markus Makela
47e2e4d3e0 Configuration parameters were uninitialized
The creation of a CONFIG_PARAM didn't initialize the qdf_param_type value which
was later used when adding parameters to the monitors.
2015-11-21 03:44:06 +02:00
counterpoint
edb84ab119 Fix logic errors in determine monitor event type, improve comments. 2015-11-20 12:13:43 +00:00