31 Commits

Author SHA1 Message Date
Markus Mäkelä
9280f1a5d7 MXS-1367: Add timeouts for retried queries
The total timeout for the retrying of interrupted queries can now be
configured with the `query_retry_timeout` parameter. It controls the total
timeout in seconds that the query can take.

The actual connection, read and write timeouts of the connector aren't a
good configuration value to use for abstracted queries as the time that it
takes to execute a query can be composed of both connections, reads and
writes. This is caused by the usage of MYSQL_OPT_RECONNECT that hides the
fact that the connector reconnects to the server when a query is
attempted.
2017-10-03 13:03:49 +03:00
Markus Mäkelä
f1f8a4b5b2 MXS-1367: Retry interrupted queries
The new `query_retries` parameter controls how many times an interrupted
query is retried. This retrying of interrupted queries will reduce the
rate of false positives that MaxScale monitors detect.
2017-10-03 10:57:10 +03:00
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Johan Wikman
6b6fd83f26 Remove revision comments 2017-02-01 11:50:38 +02:00
Esa Korhonen
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
Esa Korhonen
b187afdcf4 Move config_runtime.h and externcmd.h to core
+ some cleanup
2017-01-24 13:05:21 +02:00
Esa Korhonen
6e38276a20 Rename files, removing "gw"-prefix
Also gwdirs.h.in -> paths.h.in
2017-01-20 12:55:52 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
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ä
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ä
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ä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
66430a3584 Fix persisted monitors not working
This prevented persisted monitors from being deleted after a restart.
2017-01-03 20:18:15 +02:00
Johan Wikman
777ea3ef43 Make config_truth_value() const correct 2016-12-08 14:58:48 +02:00
Markus Makela
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
Markus Makela
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
Markus Makela
b893ca7ba8 Move configuration context processing into subfunctions
The functions allow simple operations on configuration context
objects. This makes it easier to understand what the code does and allows
reuse of the configuration processing code.
2016-11-14 22:58:26 +02:00
Johan Wikman
8c20ad5cd0 MXS-304: Support hierarchical reload
'reload config' now also processes all configuration files
of a hierarchy.
2016-10-31 12:48:38 +02:00
Johan Wikman
1be3bb9b8d Minor cleanup of config.[h|c]
- Add const where applicable.
- Cleanup header files.

Fix collateral damage (statistics.c) as well.
2016-10-27 15:55:26 +03:00
Johan Wikman
d7ce3ad75b Replace include guards with #pragma once 2016-10-26 08:23:15 +03:00
Johan Wikman
03dbc6df80 Remove dependency on skygw_utils.h
- STRERROR_BUFLEN moved to cdefs.h and renamed to MXS_STRERROR_BUFLEN.
  Better would be to provide a 'const char* mxs_strerror(int errno)'
  that would have a thread specific buffer for the error message.
- MIN and MAX also moved to defs.h as MXS_MIN and MXS_MAX.
- Now only mlist.h of the headers depend upon skygw_utils.h.
2016-10-14 15:42:02 +03:00
Johan Wikman
c03b8079fd Move @file comment
Where it exists, the @file comment has now been moved to be
consistently right after the license blurb.
2016-10-14 13:20:52 +03:00
Johan Wikman
1a978be6b6 Cleanup header files
- All now include maxscale/cdefs.h as the very first file.
- MXS_[BEGIN|END]_DECLS added to all C-headers.
  Strictly speaking not necessary for private headers, but
  does not hurt either.
- Include guards moved to the very top of the file.
- #pragma once added.
2016-10-14 11:54:37 +03:00
Johan Wikman
76430e060f maxconfig.h renamed to config.h 2016-10-13 22:59:39 +03:00