Commit Graph

294 Commits

Author SHA1 Message Date
3eef2648e1 MXS-2313: Expose only two rank values
The rank can now only be used to define two groups of servers: primary and
secondary servers. This limits the exposure and reduces the number of
possibilities that can arise from the use of this parameter thus making it
more predictable.
2019-03-18 13:12:59 +02:00
6f8bfd7d11 MXS-2313: Add enum to value conversion function
The helper function makes it easier to convert enum values at runtime to
their integer representation. Also changed the configuration processing
code to use the new function.
2019-03-18 13:12:59 +02:00
9b6b5270f1 MXS-2313: Use 64-bit integers to store rank
Although the default value is the maximum value of a signed 32-bit
integer, the value is stored as a 64-bit integer. The integer type
conversion functions return 64-bit values so storing it as one makes
sense.

Currently values higher than the default are allowed but the accepted
range of input should be restricted in the future.
2019-03-18 13:12:58 +02:00
0693514047 MXS-2313: Add server ranks
The servers now accept a rank parameter that tells which servers to
prioritize.
2019-03-18 13:10:23 +02:00
14b4fa632a MXS-2271 Move Monitor inside maxscale-namespace
Rearranged monitor.cc by namespace.
2019-03-15 12:57:35 +02:00
ac5ee1278c MXS-2271 Cleanup internal monitor header and its functions
Some functions still accessed the servers-array. Most functions are now
inside class. Removed unused defines.
2019-03-12 15:32:56 +02:00
e7abc53b70 MXS-2304 Clean up configuration serialization
The parameters are now written in the order they appear in the module
parameter definitions. Also enabled a previously disabled part in
server unit test.
2019-03-12 12:51:23 +02:00
703f65700a Use INT with retain_last_statements
The default value is negative so the type must be INT in order to support
reading of serialized configurations.
2019-03-11 21:49:33 +02:00
1c3a5bda83 Merge branch '2.3' into develop 2019-03-11 12:29:56 +02:00
7f27db02a8 Fix global retain_last_statements
The default value was wrong.
2019-03-08 14:45:18 +02:00
5005facfb1 Always dump the full configuration
Always storing runtime configuration changes prevents problems when the
change causes another parameter to change. One example of this is
transaction_replay that implicitly enables other parameters.
2019-03-08 12:10:31 +02:00
c2459c420d MXS-2304 Rename fields of CONFIG_CONTEXT
Added m_-prefix.
2019-03-04 12:27:36 +02:00
900cbb4cff MXS-2304 Move last config_get_x() functions inside class 2019-03-04 12:27:36 +02:00
2a63fb0776 MXS-2304 Store config parameter container as value in monitor and service 2019-02-22 16:53:17 +02:00
3fa4a85a1e MXS-2304 Use values instead of pointers in CONFIG_CONTEXT
Simplifies ctor/dtor.
2019-02-22 16:39:45 +02:00
5828c93112 MXS-2304 Convert static config parameter methods to non-static
Parameter handling changed in several places.
2019-02-22 15:17:55 +02:00
b64e9b3ee0 MSX-2304 Store configuration parameters in a map
Also adds begin() and end() functions for loops.
2019-02-22 15:04:14 +02:00
9fbaafea91 MXS-2304 Remove additional module parameter classes
Equivalent functionality is now in the basic config parameter class.
2019-02-19 13:52:44 +02:00
f1dcc4ac98 MXS-2304 Remove config_get_value()
Replaced with other functions.
2019-02-18 11:34:15 +02:00
f91a8813ea Reject "passwd" in monitor and service configs
Was deprecated in 2.3.
2019-02-18 11:34:15 +02:00
25a53a649a MXS-2304 Remove config_get_param()
Replaced with other functions. Also removed password deprecation check.
2019-02-15 10:48:19 +02:00
1fed465fdb MXS-2246 Remove duplicate info in SERVICE and Service
Both of them contained fields for the service and router names.
Now the names are in SERVICE and they must be accessed via member
function.
2019-02-14 15:24:10 +02:00
c116452c25 MXS-2253 Add MXS_MODULE_PARAM_DURATION
Added a new module parameter type to be used for parameters
that specify a duration. With the suffixes 'h', 'm', 's' and
'ms' the duration can be specified in hours, minutes, seconds
or milliseconds, respectively.

Irrespective of how the duration is specified, it is always
returned as milliseconds.

For backward compatibility, when a duration value is read it must
be specifed how a value *not* defined using a suffix should be
interpreted; as seconds or milliseconds.

  value = param->get_duration(name, mxs::config::INTERPRET_AS_SECONDS);
2019-02-14 10:57:55 +02:00
cac1d76e48 MXS-2314 Monitor decides whether servers are added to services
When the servers of a service are defined by a monitor, then
at startup all servers of the monitor should be added to relevant
services. Likewise, when a server is added to or removed from a
monitor at runtime, those changes should affect services as well.

However, whether that should happen or not depends upon the monitor.
In the case of the Clustrix monitor this should not happen as it
adds and removes servers depending on the runtime state of the
Clustrix cluster.
2019-02-11 13:03:18 +02:00
b4eb87dfcc MXS-2314 Populate services with servers
The services whose servers are defined using a monitor, will
now be populated from the monitor.

Note, no consideration has yet been given to runtime changes.
2019-02-11 13:03:18 +02:00
f271c5cea1 MXS-2314 Add 'cluster' parameter to service
Using the cluster parameter, the servers of a service can be
defined using a monitor.

This change basically only introduces the parameter.
2019-02-11 13:03:18 +02:00
1073bc1832 Remove false assertion
The list can be empty
2019-02-11 12:40:43 +02:00
35ab911d5c MXS-2304 Use configuration class methods instead of separate implementations
Replaces parameter add/set/remove/free.
2019-02-07 13:51:16 +02:00
ed80680da9 MXS-2304 Add ctor/dtor and other functions to parameter class
The manipulation functions are currently static so that the container can be initialized
if required. This will be fixed later.

The new functions are taken into use in monitor management.
2019-02-07 13:51:16 +02:00
934be45b68 MXS-2304 Remove config_get_string() and config_get_value_string()
Some functions accessing internal pointers still remain.
2019-02-06 12:58:59 +02:00
78d9ef2910 MXS-2304 Remove remaining uses of config_get_string() from module code
The function returns a pointer to an internal string and should not be
used.
2019-02-06 12:36:23 +02:00
5ab7734e9d MXS-2304 Add contains() to test if a parameter exists
Replaces uses of config_get_param() in modules either with contains()
or get_string(). The config_get_param() is moved to internal headers,
as it allows seeing inside a config setting.
2019-02-06 12:36:23 +02:00
4132c9bbbc MXS-2304 Use get_c_str_copy instead of config_copy_string()
Also uses get_string() in core-code when appropriate.
2019-02-05 10:28:37 +02:00
3eb7d89c80 MXS-2304 Use get_service() and get_server() 2019-02-01 17:31:41 +02:00
882d360355 MXS-2304 Use get_size() instead of config_get_size() 2019-02-01 17:23:14 +02:00
b357717149 MXS-2304 Use get_bool() instead of config_get_bool() 2019-02-01 17:18:49 +02:00
7cb969b0d9 MXS-2271 Clean up server list parsing functions, use in monitor config
The functions now return the parsed array.
2019-02-01 14:59:51 +02:00
6038f1f386 Merge branch '2.3' into develop 2019-02-01 13:55:54 +02:00
f2d2202ea3 MXS-2304 Use get_enum() instead of config_get_enum() 2019-02-01 10:29:24 +02:00
c8a84cebd0 MXS-2304 Use get_integer() instead of config_get_integer() 2019-01-31 18:12:25 +02:00
63b5eab89e MXS-2304 Convert configuration management structs to classes
The fields of MXS_CONFIG_PARAMETER remain unchanged so that parameter
processing can be changed gradually.
2019-01-31 17:57:16 +02:00
3f4c72d4f2 MXS-2303: Fix missing parameter error
The detection of missing parameters that define which module to load must
be done before the module is loaded.
2019-01-31 14:23:27 +02:00
df9335382d Fix qc cache memory usage message
A zero value would get printed as -nanYiB.
2019-01-31 14:23:16 +02:00
9083ea2d02 MXS-2290 Reject use of whitespace in section names
Whitespace in section names was deprecated in 2.2 and in 2.4 it
will be rejected.
2019-01-28 12:22:28 +02:00
5afceb1185 MXS-2274 Reserve names starting with @@ for use by MaxScale
Names starting with '@@' can now longer be used in configuration files.
Subsequent commits will prevent such names from being used when objects
are created dynamically.
2019-01-24 17:42:29 +02:00
f559bf3d95 MXS-2271 Move disk space settings to a settings-container 2019-01-24 09:49:53 +02:00
9ac8bf93bb MXS-2271 Rename monitor-related classes
MXS_MONITOR->Monitor
MonitorInstance->MonitorWorker
MonitorInstanceSimple->MonitorWorkerSimple
2019-01-22 15:59:17 +02:00
3321a591ef MXS-2271 Move some monitor management functions to an internal class
The class MonitorManager contains monitor-related functions that should not
be called from modules. MonitorManager can access private fields and methods
of the monitor.
2019-01-22 10:31:06 +02:00
1c647f3753 MXS-2220 Move most remaining functions inside class
Most of the ones still remaining outside are special cases.
Also, removed locking from status manipulation functions as it
has not been required for quite some time.
2019-01-08 15:15:34 +02:00
d5c78eb31f MXS-2220 Move more server functions inside class 2019-01-08 15:12:47 +02:00