59 Commits

Author SHA1 Message Date
Johan Wikman
d632c195ff 2.4.19 Update change date 2022-01-04 15:47:38 +02:00
Johan Wikman
2a54224927 2.4.18 Update change date 2021-10-29 08:29:51 +03:00
Johan Wikman
a8bfbbe254 2.4.17 Update change date 2021-03-08 09:03:02 +02:00
Johan Wikman
0224f24077 2.4.16 Update Change Date 2021-02-16 14:59:00 +02:00
Johan Wikman
c5bcf7a8b1 2.4.15 Update change date 2021-01-18 15:30:30 +02:00
Johan Wikman
df36ef86d0 2.4.14 Update Change Date 2020-11-16 14:23:26 +02:00
Johan Wikman
faaf7f483e 2.4.13 Update Change Date 2020-10-14 09:15:46 +03:00
Johan Wikman
babcda3eca 2.4.12 Update Change Date 2020-08-24 09:42:48 +03:00
Johan Wikman
fc9c9fcd77 2.4.11 Update change date 2020-07-07 10:01:38 +03:00
Johan Wikman
5ebae9be90 Merge branch '2.3' into 2.4 2020-06-05 09:36:24 +03:00
Johan Wikman
aa11c960b1 2.3.20 Update change date 2020-06-05 09:31:45 +03:00
Markus Mäkelä
d3d7054639
Merge branch '2.3' into 2.4 2020-04-24 16:09:20 +03:00
Johan Wikman
f527a8f2e6 2.3.19 Update Change Date 2020-04-23 14:23:57 +03:00
Johan Wikman
d0ab797938 Merge branch '2.3' into 2.4 2020-03-12 10:33:57 +02:00
Johan Wikman
e0cd6adb26 Update change date for 2.3.18 2020-03-10 10:45:47 +02:00
Johan Wikman
8b763fb88b Merge branch '2.3' into 2.4 2020-02-12 08:27:48 +02:00
Johan Wikman
cfb3f79b54 Update 2.3.17 Change Date 2020-02-10 15:28:38 +02:00
Johan Wikman
a7e0142224 Merge branch '2.3' into 2.4 2020-01-15 11:29:37 +02:00
Johan Wikman
790d90f229 Update 2.3.16 Change Date 2020-01-15 11:08:51 +02:00
Johan Wikman
a9a2b753c0 Update 2.4.5 change date 2019-12-18 13:25:03 +02:00
Johan Wikman
f6731a898d Update change date 2019-11-13 08:37:17 +02:00
Johan Wikman
fdfbf3e133 Update 2.4.3 change date 2019-11-05 12:21:00 +02:00
Johan Wikman
861e27eb00 Merge branch '2.3' into 2.4 2019-10-29 14:04:31 +02:00
Johan Wikman
df6c56e7ca Update 2.3.13 Change Date 2019-10-29 12:51:31 +02:00
Johan Wikman
0ba779d5a2 Update 2.4.0 Change Date 2019-06-25 10:11:55 +03:00
Markus Mäkelä
4e2d350838
MXS-2483: Return std::unique_ptr from SSLContext::create
Smart pointers are far nicer than raw pointers.
2019-05-24 10:05:43 +03:00
Markus Mäkelä
cab336ed89
MXS-2483: Rename SSL_LISTENER to mxs::SSLContext 2019-05-20 15:45:18 +03:00
Esa Korhonen
5077ad62df Move monitor runtime modification functions to MonitorManager
Requires moving some general configuration checking functions to
config.cc.
2019-05-10 14:48:41 +03:00
Markus Mäkelä
3813c728b1
Move listener parameter handling into Listener::create
The Listener::create method now takes a set of configuration parameters
from which it constructs a listener. This removes the duplicated code and
makes the behavior of listener creation similar to other objects in
MaxScale. It also allows the configuration parameters to be stored in the
listener object itself.
2019-05-10 09:21:52 +03:00
Markus Mäkelä
59be841939
MXS-2414: Rename max_auth_failures to max_auth_errors_until_block 2019-04-30 14:49:36 +03:00
Markus Mäkelä
db0e491ace
MXS-2414: Add max_auth_failures parameter
The parameter controls how many authentication failures are allowed until
the host is blocked. The default is 10 failures per thread.
2019-04-30 14:49:35 +03:00
Johan Wikman
09702ab0a0 MXS-2346 Provide new configuration mechanism
The configuration mechanism consists of the following concepts:

Specification
  Specifies the available configuration parameters of a module,
  their names and their types.
Param
  Specifies a parameter, its name and its type.
Type
  Specifies the type of a configuration parameters; Bool, Size,
  Count, etc.
Configuration
  Specifies the configuration values of a particular instance of
  the module. Configuration walks hand in hand with Specification,
  the latter specifies what the former should contain.

A Specification is capable of configuring a Configuration from a
MXS_CONFIG_PARAMETER, checking in the process that all parameters
are of the correct type and that the required parameters are present.

A Specification is capable of persisting itself so that it later
can be read back.

The mechanism is closed for modification but open for extension in
the sense that if a module requires a custom parameter, all it needs
to do is to derive one class from Param and another from Type.

The canonical way for using this mechanism is as follows. Consider
a module xyx that has three parameters; a parameter called
"enabled" that is of boolean type, a parameter called "period"
that is of duration type, and a parameter "cache" that is of
size type. That would be declared as follows:

    // xyz.hh
    class XYZSession;

    class XYZ : public maxscale::Filter<XYZ, XYZSession>
    {
    public:
        static XYZ* create(const char* zName, MXS_CONFIG_PARAMETER* pParams);

    private:
        XYZ();

        static config::Specification                       s_specification;
        static config::ParamBool                           s_enabled;
        static config::ParamDuration<std::chrono::seconds> s_period;
        static config::ParamSize                           s_cache;

        config::Configuration                              m_configuration;
        config::Bool                                       m_enabled;
        config::Duration<std::chrono::seconds>             m_period;
        config::Size                                       m_cache;
    };

    // xyz.cc

    config::Specification XYZ::s_specification(MXS_MODULE_NAME);

    config::ParamBool XYZ::s_enabled(
        &s_specification,
        "enabled",
        "Specifies whether ... should be enabled or not."
        );
    config::ParamDuration<std::chrono::seconds> XYZ::s_period(
        &s_specification,
        "period",
        "Specifies the period. Rounded to the nearest second."
        );
    config::ParamSize XYZ::s_cache(
        &s_specification,
        "cache",
        "Specifies the size of the internal cache."
        );

    XYZ::XYZ()
        : m_configuration(&s_specification)
        , m_enabled(&m_configuration, &s_enabled)
        , m_period(&m_configuration, &s_period)
        , m_cache(&m_configuration, &s_cache)
    {
    }

    XYZ* XYZ::create(const char* zName, MXS_CONFIG_PARAMETER* pParams)
    {
        XYZ* pXyz = new XYZ;

        if (!s_specification.configure(pXyz->m_configuration, pParams))
        {
            delete pXyz;
            pXyz = nullptr;
        }

        return pXyz;
    }
2019-04-12 15:03:02 +03:00
Markus Mäkelä
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
Esa Korhonen
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
Esa Korhonen
2a63fb0776 MXS-2304 Store config parameter container as value in monitor and service 2019-02-22 16:53:17 +02:00
Esa Korhonen
3fa4a85a1e MXS-2304 Use values instead of pointers in CONFIG_CONTEXT
Simplifies ctor/dtor.
2019-02-22 16:39:45 +02:00
Esa Korhonen
25a53a649a MXS-2304 Remove config_get_param()
Replaced with other functions. Also removed password deprecation check.
2019-02-15 10:48:19 +02:00
Johan Wikman
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
Esa Korhonen
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
Esa Korhonen
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
Esa Korhonen
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
Esa Korhonen
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
Esa Korhonen
b0663f0b29 Convert maxscale/ssl.h to .hh 2019-01-15 17:12:32 +02:00
Markus Mäkelä
f0f9c21d1c
Merge branch '2.3' into develop 2019-01-07 10:54:42 +02:00
Markus Mäkelä
050ce7f1a3
MXS-2200: Add runtime handling for all global parameters
All global parameters are now handled by the runtime configuration
modification code. The parameters that are trivial to update can now be
updated at runtime. All other global parameters cause a new error message
to be returned stating that the parameter in question cannot be modified
at runtime.

Also updated the list of modifiable parameters in MaxCtrl. This list
should not be stored in MaxCtrl and should be created by MaxScale at
runtime.
2019-01-03 09:37:59 +02:00
Markus Mäkelä
77585bdb8c
MXS-2197: Make config.h and service.h C++ headers
This is the first step into converting the other headers into C++.
2018-11-30 12:15:57 +02:00
Markus Mäkelä
7deed35587
Merge branch '2.2' into 2.3 2018-10-31 09:03:09 +02:00
Niclas Antti
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
Niclas Antti
24ab3c099c Move top of the file "#pragma once" to after the following comment (swap them). If the comment is a BPL update it to the latest one 2018-08-21 13:13:15 +03:00
Markus Mäkelä
e5c2b1a8c4
Create JSON serialization from object parameters
The services, monitors and filters now construct the JSON format
parameters from the configuration parameters. This reduces the need for
the amount of explicit operations and makes adding new parameters easier.
2018-08-20 13:56:59 +03:00