6592 Commits

Author SHA1 Message Date
Johan Wikman
e1a43c15c5 Masking: Add error handling
When receiving an error packet, we just abort whatever we were doing.
2017-01-12 14:44:04 +02:00
Johan Wikman
9a85b8eb06 Masking: Handle multi results 2017-01-12 14:44:04 +02:00
Johan Wikman
9a95e79dd6 Masking: Add parameter for warnings
The masking filter can now be instructed to warn in case a masking
rule matches a column of a type that is not masked.
2017-01-12 14:41:55 +02:00
Johan Wikman
e79e82b0a9 Update masking documentation 2017-01-12 14:41:55 +02:00
Johan Wikman
3acb43e2ed Address only specific type of columns when masking
Only columns that are of string kind are now subject to masking.
With a textual resultset it would be possible to mask anything the
same way, but with a binary resultset it is not. Thus, so that the
result is not dependent upon whether the resultset happens to be
textual or not, only string fields are accessed. Documentation to be
updated in a separate change.

The utility classes have now also been rearranged somewhat.
2017-01-12 14:41:55 +02:00
Johan Wikman
10ba67be3c Handle binary resultsets in maskingfilter 2017-01-12 14:40:16 +02:00
Johan Wikman
43c81baf70 Add utility classes for dealing with binary resultsets 2017-01-12 14:40:16 +02:00
Johan Wikman
2fa12f796b Rename MYSQL_GET_PACKET_LEN to MYSQL_GET_PAYLOAD_LEN
The function returns the length of the payload, not the length of
the entire packet.
2017-01-12 14:24:14 +02:00
MassimilianoPinto
77aff88ed7 Maxbinlogcheck gets stuck when binlog file is not existant/readable
Missing exit() caused maxbinlogcheck being stuck on log_manager call
when specified binlog file is not existed/redable
2017-01-11 15:30:57 +01:00
Markus Mäkelä
0865eada03 Add module configuration directory
This directory is intended to be the default working directory for
relative pathname resolution. The actual implementation for
MXS_MODULE_PARAM_PATH is done at a later step.
2017-01-11 14:24:26 +02:00
Markus Mäkelä
a196420c2d Move monitor script processing and launching into the core
This removes parts of the nearly identical code from all monitors.

The removal of monitor type specific event checking is done based on the
assumption that only the monitor that is monitoring the server can be the
cause for a state change. This removes the need to actually check that the
state change is relevant for each monitor and allows the event handling to
be moved into the core.
2017-01-11 14:21:57 +02:00
Markus Mäkelä
7ef5e4bfd9 Use module parameters in maskingfilter
The maskingfilter still does some processing due to the fact that it
accepts relative pathnames. This should ideally done by the core in a
controlled manner and for all path parameters.
2017-01-11 13:06:40 +02:00
Johan Wikman
8612561bbd Fix placement of default 2017-01-11 13:02:19 +02:00
Markus Mäkelä
0c6739ebd3 Use config_copy_string in luafilter
The function is intended to be used with string parameters that are
optional and are copied when defined. This removes the need to copy the
string to a local variable to perform checks on the value.
2017-01-10 20:50:12 +02:00
Markus Mäkelä
b39c47e4df Only try to install /var/lib/maxscale for core package
The only package that should even attempt to install the lib folder is the
main package.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
dffad71804 Add support for comparison operators in dbfwfilter functions
The dbfwfilter now supports the main comparison operators in MySQL. The
string versions (IS, NOT, IS NOT etc.) are not supported.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
6c9a80e957 Log a message when rules are reloaded
When the rules are reloaded, it is prudent to log a message. This will
help in the analysis of logs.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
cad7b6446d Move dbfwfilter rule matching into subfunctions
This makes the code more readable.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
67894b2c7b Prevent prepared statement use with dbfwfilter
Since the prepared statements can't be processed, they should not be
allowed.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
1ceafb9723 Add function blocking to dbfwfilter
The dbfwfilter now supports blocking of individual functions.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
990ecfc114 Use module parameters in dbfwfilter
The dbfwfilter now uses module parameters.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
a1293fbd79 Add unique constraint to enumeration parameters
Enum parameters can now be declared unique. This prevents multiple values
for enumerations which only accept one value.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
73a1388468 Check and create binlogdir and avrodir before use
The binlog and avro file directories should be checked before they are
used and if they don't exist, they should be created.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
1ff78f3504 Fully enable pre-processing config checks
The configuration checks for module parameters are now fully in use. By
removing the hard-coded values from the list of accepted values, the
modules take control of what parameters are accepted.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
c06a95ff92 Use module parameters in binlogrouter
The binlogrouter accepts all router options also as parameters.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
b352458870 Add size type to module parameters
The type represents byte sizes used for configuring buffers and file
sizes. The supported suffixes for binary units are k, m, g and t in both
upper and lower case.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
2ee257eb48 Fix minor filter problems
Regexfilter tried to retrieve wrong parameter and the `options` parameter
was not added to the filters.
2017-01-10 16:52:28 +02:00
Markus Mäkelä
da5d53bbe0 Fix enum parameter checks
The enums weren't properly parsed when they were checked.
2017-01-10 16:52:28 +02:00
Markus Mäkelä
9803dc3f8c Fix build failure on Fedora 25
The std::tr1::shared_ptr needs to be explicitly used inside the function
or the std::tr1 namespace replaced with std:: namespace.
2017-01-10 16:52:28 +02:00
MassimilianoPinto
e0c33cbfee Add COM_STMT_EXECUTE support to maxrows
Prepared statements execution via COM_STMT_EXECUTE is now handled
2017-01-10 12:10:30 +01:00
MassimilianoPinto
45e26c63a5 Fix for bref_cmp_current_load() algorithm.
Fix for bref_cmp_current_load() algorithm when weight is present
2017-01-10 12:02:16 +01:00
MassimilianoPinto
f32471d1cb Fix for operations used instead of connections
Fix for operations used instead of connections in
bref_cmp_current_load()
2017-01-10 12:02:16 +01:00
MassimilianoPinto
a60a0032d1 Server weight is taken into account for LEAST_BEHIND_MASTER selection criteria
Server weight is taken into account for LEAST_BEHIND_MASTER selection
criteria
2017-01-10 12:02:16 +01:00
Markus Mäkelä
b507976414 Use a constant instead of a hard-coded parameter limit
Limits are better defined with constants that can be reused elsewhere.
2017-01-09 14:17:34 +02:00
Markus Mäkelä
d6d564c44d Use module parameters in topfilter and tpmfilter
The topfilter and tpmfilter now use the module parameteres.

Also removed some unnecessary variables and included maxscale/cdefs.h in
tpmfilter.
2017-01-09 14:17:34 +02:00
Markus Mäkelä
e6b7035766 Use module parameters in regexfilter and tee
The regexfilter and tee now use the module parameters.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
92386922a9 Use module parameters in qlafilter
Moved the qlafilter parameters to module options. This removes the need to
parse the options in the filter.

Split the options into separate parameters. This allows common options to
be combined as enumerations under common parameters.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
c500ddc768 Use module parameters in namedserverfilter
The namedserverfilter module now uses the module parameters.

Added new server type parameter which is validated both at startup and
runtime.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
9b2d382232 Use module parameters in mqfilter
Cleaned up mqfilter createInstance and converted it to use module
parameters.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
dd372cda17 Use module parameters in maxrows
The maxrows filter now uses module parameters.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
f156b1e4ee Add minimum and maximum values for integer parameters
The defined integer values can be used to give a default value the maximum
for its type.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
11ab4575c3 Use module parameters in ccrfilter and luafilter
The ccrfilter and luafilter now use the module parameters.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
180ed1616a Add configuration test
The test validates, parses and creates configuration parameters for
modules.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
56ecdc219b Refactor config.c functions for testing
To test the configuration validation and default value generation, the
functions needed to be refactored to allow parameters to be passed
directly to the function.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
eef0619865 Add default parameters to created monitors
When a monitor is created at runtime, it also needs to have the default
parameters. Ideally, this would be done when the monitor is allocated but
because of the way the configuration is processed, we need to do it after
user defined parameters are added.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
72ea3ad453 Fix improper use of monitorStart
Some uses of monitorStart didn't pass the monitor parameters to the
function call. This caused runtime configuration of monitors to not have
any parameters as they never got their parameters.
2017-01-09 14:17:33 +02:00
Johan Wikman
75c257327e Fix G++ 4.4 issue
G++ 4.4 on CentOS6 seems to get confused by direct inheritance
from templates. Worked around by introducing typedef.
2017-01-09 13:17:49 +02:00
MassimilianoPinto
7c13b56e74 Fix compilation error on CentOS6
Fix compilation error on CentOS6
2017-01-09 12:07:18 +01:00
Johan Wikman
c3ddc3ac22 Cleanup server.h
- All (but the printing/debug functions) are now in snake_case.
- Functions made const correct.
- All function prototypes now have named arguments.

Documentation still to be moved, and file possibly split into
include/mascale/server.h and server/core/maxscale/server.h
2017-01-09 12:14:46 +02:00
Esa Korhonen
1b8742781b MXS-804 Handle hosts of form ip/netmask
Previously, these were discarded. This patch adds a function to
"merge" the mask to the ip so that it's in the form which
normalize_hostname expects (using % as wildcard). Only simple masks
with 255:s and 0:s are accepted. Any other combinations may leave
the hostname in a garbled state which will cause it to be discarded
later.
2017-01-09 10:05:35 +02:00