Commit Graph

6561 Commits

Author SHA1 Message Date
410ba7726e Copy avrorouter options to parameters
The avrorouter router_options values can now also be defined as
parameters. This should make the configuration definition a lot cleaner.
2017-01-05 10:50:02 +02:00
257cb5c209 Add path and service module parameter types
The path type is validated if the module requested path
validation. Service checks can be done both on startup and at
runtime. This allows dynamic changes to module parameters to be validated
without a configuration context.
2017-01-05 10:48:58 +02:00
e0ad6188ad Add module parameter options
The options allow the modules to impose type specific restrictions on the
parameters. This can be used to offload file permission and mandatory
parameter checks to the core.
2017-01-05 10:48:58 +02:00
2b50ce6548 Create defines for default directories
This allows the default directories to be used in initializers where
constant expressions are required.
2017-01-05 09:58:11 +02:00
4c008844ca Always include maxscale/cdefs.h first
Two headers didn't include the file.
2017-01-05 09:58:11 +02:00
2e074f4eb4 Introduce common SQLite header
The header declares the missing v2 handle closing function for older
versions of SQLite.
2017-01-05 09:58:11 +02:00
5a290cb0b8 Use module parameters in monitors
All monitors now declare the parameters that they use. This allows the
core to check the validity of the parameters before they are passed to the
monitor. It also simplifies the processing of the parameters as they are
guaranteed to be valid.
2017-01-05 09:58:11 +02:00
cefc253e2c Check configuration with declared parameters
The declared parameters are now used to check whether the configuration is
valid. As the filters and monitors don't use the new declarations, the
code needs to be commented out. Once the parameter processing has been
migrated to the new system, the code can be enabled.
2017-01-05 09:58:10 +02:00
f7c6accaa0 Load default configuration values for modules
Filters, monitors and routers can now declare parameters and those
parameters will always be present. Currently, this removes the need to
parse simple values like booleans and integers.

Some of the more common parameter types could be added in the future
e.g. paths to files.
2017-01-05 09:58:10 +02:00
241dbb464a Add framework for declaration of module parameters
The MXS_MODULE structure now contains a member for parameters. This can be
used by the modules to declare accepted parameters, their types and the
default values. Currently only count, integer, boolean, string and enum
values are supported.
2017-01-05 09:58:10 +02:00
83957a503c Binlog encryption check against openssl 1.0
AES_CTR routines are part of openssl 1.0.

If an old library is in use the AES_CTR cannot be specified for
encryption.

Additionally compilation is done without errors.
2017-01-04 15:15:40 +01:00
8d219bf8f5 Fix CentOS5 issues 2017-01-04 11:27:57 +02:00
83eddabebc Add missing newline 2017-01-04 10:53:21 +02:00
801c6cfbef Define _GNU_SOURCE in include/maxscale/cdefs.h 2017-01-04 09:55:52 +02:00
33d98830dd Provide read-only access to loaded modules
The MXS_MODULE structure of each module is now globally exposed by the
`get_module` function. This allows the module information of any module to
be queried.

This information can then be used to validate various things but the main
goal is to provide a way for modules to declare accepted parameters in the
MXS_MODULE structure. This will be done in a later commit.

Also the function documentation is now in the header file. This should
make it easier to read.
2017-01-04 07:39:47 +02:00
0215ad32a1 Fix double declaration of _XOPEN_SOURCE
The adminusers.c file declared it twice; first explicitly and then
implicitly by including cdefs.h.
2017-01-04 05:55:55 +02:00
f78db1aab9 Fix modinfo.h comments
The comments referred to a non-existent type.
2017-01-03 20:19:22 +02:00
66430a3584 Fix persisted monitors not working
This prevented persisted monitors from being deleted after a restart.
2017-01-03 20:18:15 +02:00
2a4714500f Fix the symbols exported by query classifiers
The query classifiers only export the needed symbols and these weren't
adjusted to the changes in the entry point names.
2017-01-03 19:16:56 +02:00
09111a73ee Clarify router_options in rwsplit documentation
This adds the required "router_options="-text to the examples. Also
adds a two-option example.
2017-01-03 18:28:59 +02:00
c96bd64aa8 Rename MODULE_INFO to MXS_MODULE
The MODULE_INFO is now the main object which is used by modules to convey
information to the MaxScale core. The MXS_MODULE name is more apt as it
now contains the actual module definition.

The old MODULES structure was moved into load_utils.c as an internal
implementation and was renamed so that it is not confused with the new
MODULE structure.
2017-01-03 18:01:14 +02:00
d42c6b455d Remove webserver.c
The file was never used.
2017-01-03 18:01:13 +02:00
b00e0328d5 Create a macro for module declarations
The modules are now declared with a common macro. This allows future
additions to the module loading process while also making the loaded
symbol name a constant.
2017-01-03 18:01:13 +02:00
ae0577c695 Move module object inside MODULE_INFO
This allows modules to only expose one entry point with a consistent
signature. In the future, this could be used to implement declarations of
module parameters.
2017-01-03 18:01:13 +02:00
6c53999c97 Combine ModuleInit and GetModuleObject
The two functions can be combined into one as both are called only
once. This removes the need for the explicit ModuleInit function.
2017-01-03 18:01:13 +02:00
7df29aa1ec Move version entry point into MODULE_INFO
The MODULE_INFO can easily hold the version information of the
module. This removes the need for a explicit version entry point.
2017-01-03 18:01:13 +02:00
d3907882d6 Clean up the module handling functions
Cleaned up the loading and unloading of modules. Declared variables closer
to where they are used.
2017-01-03 18:01:13 +02:00
bbee47ee13 Fix release build breakage 2017-01-03 14:48:11 +02:00
78928dc575 Make session_[getUser|get_remote] const correct
- Rename session_getUser to session_get_user
- Change session_get_user and session_get_remote to take a const
  SESSION* as argument and to return a const char*.
- Change server_get_persistent, so that user is passed as const.
- Update all users of these functions as appropriate.
2017-01-02 16:16:37 +02:00
58dea62e24 Remove Gatekeeper 2017-01-02 10:00:40 +02:00
eaf3633728 Only flush tables to disk at the end of the binlog
Currently, when the avrorouter finishes reading a binlog file or when a
certain number of rows or transactions is reached, it will flush all
tables to disk. This is quite slow as events can easily be written faster
into the binlog than they can be processed by avrorouter.

A solution to this would be to only sync the tables (close the Avro block)
instead of flushing them to disk. This would allow more efficient
processing of the files while still retaining the safe shutdown that
flushing offers.
2017-01-02 09:31:21 +02:00
30a3475898 Add documentation for masking filter
MXS-910
2016-12-29 11:50:42 +02:00
cb0cb4bb09 Add maxscale::Buffer
maxscale::Buffer is a simple C++ wrapper around GWBUF that allows the
latter to be manipulated like an STL compatible collection.
maxscale::Buffer provides both a const and non-const forward iterator,
using which a non-contiguous GWBUF can be traversed and manipulated.
The iterators can be used with any standard C++ algorithm that accepts
forward iterators.
2016-12-29 11:50:42 +02:00
18008dec6d Rename mxs_mysql_account_to_pcre
The function is not capable of doing the right thing for an entire
account string, but only separately for user and host names, so the
function name should reflect that.
2016-12-29 11:47:08 +02:00
997bec868f Move transforming function to common place
Move function for converting a MySQL account string to an
equivalent PCRE one, from Cache's rules.cc to mysql_utils.
2016-12-29 11:09:06 +02:00
c6e155cf2b Move quote triming function to common place
Function for removing MySQL quote characters surrounding a
string moved from Cache's rules.cc to common place and renamed.

The function was now moved to mysql_utils.[h|c], which is in
maxscale-common, and not to the perhaps more appropriate place
protocol/mysql.h, as the latter would have implied that MySQLCommon
would have to be linked to, which actually might be the right thing
to do. However, that has to wait until protocol/mysql.h gets an
overhaul.
2016-12-29 11:09:06 +02:00
b40872e600 Prefix le[int|str]-functions with "mxs_" 2016-12-29 10:10:11 +02:00
c008d794c7 Add const correctness to mysql_util.h 2016-12-27 15:52:55 +02:00
25c3c33134 Added user creation command to CDCPlainAuth
Users for the CDC protocol can be created through the new `add_user`
module command.
2016-12-23 15:41:48 +02:00
e07826229c MaxAdmin: Document admin/mariadb as credentials
Apparently got lost when internet sockets were first removed and
then reinstated.
2016-12-23 14:32:38 +02:00
03bac0f44d Update binlog documentation
Use server_id instead of server-id and master_id instead of
master-id in the documentation.
2016-12-23 10:36:40 +02:00
c186956e0e Add skeleton masking filter 2016-12-23 09:05:08 +02:00
65ca6a4be8 MaxRows: 0x0 detection in handle_rows() removed
The 0x0 detection handle_rows was added for MULTI result detection, now
moved in handle_expecting_response.

Additionally 0x0 conflicts with empty string data.

CLIENT_DEPRECATE_EOF is not supported right now
2016-12-22 17:03:57 +01:00
6a53e70314 Documentation Update
Documentation Update covers binlog encryption
2016-12-22 16:56:53 +01:00
b9b3bfaa78 Use configured principal name
The default principal name was used instead of the configured one.
2016-12-22 17:55:05 +02:00
5664321df0 Add username and network address to newSession
The luafilter now provides the username and the network address of the
client for the newSession entry point.
2016-12-22 17:55:05 +02:00
47ac20adea Refer to sessions by ID instead of memory address
Using the unique ID for the session is easier to use than an address. This
also allows the removal of all pointer values from the maxadmin output
which is never useful to the end user.
2016-12-22 17:55:05 +02:00
2bdda586f7 Remove CLI service modes
The modes weren't used and provided access to raw memory which is not
safe.
2016-12-22 17:55:05 +02:00
7cbd62db52 Fix show dbusers
The functionality was broken by the change where the users were moved from
the service to the listener.
2016-12-22 17:55:05 +02:00
d50e25b688 Merge branch 'develop-2.0-merge-dec22' into develop 2016-12-22 17:54:45 +02:00