Commit Graph

315 Commits

Author SHA1 Message Date
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
4e50f3e0cd Fix MXS_MODULE_PARAM_SIZE handling 2017-01-30 14:23:54 +02:00
89f456840c Add monitor parameter to services
Services now accept a monitor as a source for servers. This removes the
need to redundantly list the same servers parameters in multiple places.
2017-01-27 12:19:27 +02:00
7d51864402 Clean config.h some more
Moved some typedefs to router.h and server.h, changed a few
constants to these enums. Renamed some types in config.h to
remove "Gateway".

There are still some functions in the public header which are
only used in core, but they seem to fit the theme of public functions
so were not moved.
2017-01-25 16:05:51 +02:00
9430da94b9 Further cleanup of monitor headers 2017-01-23 14:16:34 +02:00
105f626e76 IEC prefixes are matched case-insetensively
If the case of the initial character does not matter, then the case
of the following 'i' should not matter either.
2017-01-23 10:11:26 +02:00
6e38276a20 Rename files, removing "gw"-prefix
Also gwdirs.h.in -> paths.h.in
2017-01-20 12:55:52 +02:00
eff34b91fb Move modules.h to core/maxscale
Also remove some unnecessary includes + cleanup
2017-01-19 15:53:25 +02:00
7ed7f972b1 Divide monitor.h to internal and interface headers similar to filter.h
Definitions and function used by core are in
server/core/maxscale/monitor.h
Definitions and function used by plugins are in
include/maxscale/monitor.h
2017-01-19 09:50:48 +02:00
680401cf8e Rename public types and constants in monitor.h
Preparing to split monitor.h into module and core sections. Also
changed a few comments in monitor.h.
2017-01-17 15:47:13 +02:00
0b6b9c3d81 Format core source code and headers
Formatted core source code and headers with Astyle.
2017-01-17 14:47:50 +02:00
272666f3b5 Only add unknown parameters as custom server parameters
The `authenticator_options` was added as a custom server parameter which
caused it to be duplicated for serialized servers.
2017-01-17 10:47:43 +02:00
d054bc9b04 Split config.h into external and internal parts
The external config.h header defined functions and structures that are
intended to be used by modules. The internal header contains functions
that are used only by the MaxScale core.
2017-01-16 11:02:34 +02:00
cbdab48237 Remove unused functions from config.h
The header is divided into two parts, an external and an internal one. The
actual splitting is done in a later commit and this commit only prepares
the header for the split.
2017-01-16 10:56:33 +02:00
424849a9a2 Rename UPSTREAM to MXS_UPSTREAM
And DOWNSTREAM to MXS_DOWNSTREAM
2017-01-13 13:40:03 +02:00
813704440a Add relative path parameters
The path parameters now support relative paths.
2017-01-12 15:33:48 +02:00
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
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
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
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
da5d53bbe0 Fix enum parameter checks
The enums weren't properly parsed when they were checked.
2017-01-10 16:52:28 +02:00
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
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
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
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
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
f1fa982dc6 Remove qualified configuration parameters
The parameters were only used by readwritesplit. These can be substituted
with the new module parameters.
2017-01-05 19:51:22 +02:00
ae31e3b0b5 Only add default value if none is provided
The default parameter values should only be added if the configuration
doesn't have that parameter.
2017-01-05 19:51:22 +02:00
9fa2de29d9 Return enum values as integers instead of strings
If the enums are converted to the acutual enum values before they are
returned, this removes the need for the modules to process the enum
strings to enum values. This allows modules to use enumerations with
minimal effort.
2017-01-05 19:51:22 +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
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
66430a3584 Fix persisted monitors not working
This prevented persisted monitors from being deleted after a restart.
2017-01-03 20:18:15 +02:00
ac36f04f93 Add 'root_node_as_master' to list of monitor parameters
The configuration processing requires that all parameters for monitors
exist before they are used. This is wrong if we are aiming for a modular
system but is a necessary evil for the time being.
2016-12-17 00:17:49 +02:00
bb9b5a87c1 Log a message when persisted configurations are used
If no message is logged, it will be very hard to figure out where some
configurations are coming from. For this reason, it's good to log a
message whenever a persistent configuration change is taken into use.
2016-12-16 10:28:06 +02:00
777ea3ef43 Make config_truth_value() const correct 2016-12-08 14:58:48 +02:00
6d7e419ed4 Improve --config-check mode
The configuration checking now detects bad router options. This allows for
better coverage of the configuration with only the --config-check flag.
2016-12-05 13:18:20 +02:00
9df3f154cf Detect duplicate objects
Creating a monitor or a listener twice is now detected and the proper
error is printed.
2016-12-03 11:31:18 +02:00
a6df875495 Make filter const correct and use snake case
CamelCase is still in use with the printing functions.
2016-12-01 15:20:34 +02:00
4c4bd24a40 Allow module specific monitor parameters to be altered
Module specific parameters can now be altered at runtime. This allows both
the removal and addition of arbitrary monitor parameters.
2016-11-30 12:41:43 +02:00
2efa862944 Remove listmanager code
The code prevented scaling by imposing global spinlocks for the DCBs and
SESSIONs. Removing this list means that a thread-local list must be taken
into use to replace it.
2016-11-30 10:28:23 +02:00
691989ff04 Split the service header into internal and external parts
The service header in include/maxscale/ contains the public part of the
service API. These functions can be safely used by the modules.

The internal header located in service/core/maxscale/ is used by the core
to initialize MaxScale at startup or to provide other services in a more
controlled way (the config_runtime, for example).
2016-11-28 14:37:26 +02:00
e31afa28e4 Serialize created listeners to disk
The created listeners are now stored to disk like created servers
are. This allows them to be used even after a restart.

Currently, the listeners cannot be deleted and need to be manually
removed.
2016-11-24 15:22:55 +02:00
e8af6908c1 Allow creation of listener at runtime
Listeners can now be created and started at runtime. If SSL is to be used,
the required parameters must be present.
2016-11-24 10:29:04 +02:00
4a142b1ca9 MXS-929: Add errors to the modulecmd system
The modules can now return human-readable error messages to the caller of
the function. The internals of the modulecmd system also use this to
return errors to the users.

The error messages can be retrieved with a common error function which
should make it easy to use in various clients.
2016-11-22 10:46:34 +02:00
5d5802a5a0 Merge branch 'develop-2.0-merge' into develop 2016-11-16 12:57:38 +02:00
548182afe3 Fix debug assertion in config.c
The debug assertion was triggered due to a wrongly structured conditional
statement.
2016-11-15 10:50:06 +02:00