406 Commits

Author SHA1 Message Date
Markus Mäkelä
c31e78754d
Fix object name tokenization
Spaces must be considered a part of the object name in tokenization. This
ensures that the name normalization process generates correct names and
that tokens are split at correct places.
2018-07-17 11:52:23 +03:00
Markus Mäkelä
728a3f6957
Clean up filter usage in services
Using a stack-allocated vector allows the filter definition array to only
be allocated once all filters have been successfully processed.
2018-07-17 11:52:22 +03:00
Markus Mäkelä
16aece6f83
Clean up new service configuration
Removed redundant checks and dead code, replaced manual server searches
with correct ones.
2018-07-17 11:52:22 +03:00
Markus Mäkelä
4e8ac8dd4f
Fix explicit server allocation
The test cases allocated servers in a way that doesn't comfortably suit
the way the servers are now allocated. Adding a helper C++ class to load
module defaults makes it easier to do explicit server initialization in
tests.

The binlogrouter was also fixed in this commit as it uses servers much
like a test would use.
2018-07-17 11:52:21 +03:00
Markus Mäkelä
df94ef990c
Use module-type parameters for servers
The server base objects now use the module-type parameters for generic
configuration.
2018-07-17 11:52:20 +03:00
Markus Mäkelä
d28b1c9d1d
Validate SSL parameters via the module-type parameters
The configuration system that modules use allows the SSL parameter
validation to be simplified. It should also provide more consistent error
messages for similar types of errors.

The SSL_LISTENER initialization is now done in one step. There was no good
reason to do it in two separate steps for listeners but in one step for
servers.

The `ssl` parameter now also accepts boolean values. As the parameter
behaves like a boolean and looks like a boolean, it ought to be a
boolean. It still accepts the custom `required` and `disabled` values
simply for backwards compatibility.

Also added the missing freeing functions for the SSL_LISTENER type. This
prevents failed SSL_LISTENER creations from leaking memory.
2018-07-17 11:52:20 +03:00
Markus Mäkelä
177f7357e0
Use module-style parameters with filters
Filters now use the module-style parameters to automate the type checking
and default value assignment.
2018-07-17 11:52:19 +03:00
Markus Mäkelä
ddaf300783
Fix and improve configuration validation
The parameter type and value validation is now fully done for the base
module parameters as well. This fixes a problem that was introduced when
the listeners were moved to the module parameter system where the
`service` parameter values weren't fixed for the new naming style.

Added an explicit check for the module type that catches errors in the
type parameter. The lack of this parameter prevents the proper detection
of other parameters.

Also cleaned up and/or removed redundant sections of code. By treating
reserved parameters the same way as module declared ones, the same code
can be re-used for all types.
2018-07-17 11:52:18 +03:00
Markus Mäkelä
421282421c
Use module-style parameters with listeners
Listeners now use the module-style parameters to automate the type
checking and default value assignment.
2018-07-17 11:52:18 +03:00
Markus Mäkelä
5fdf82a508
Only warn about whitespace in section names
The warnings were logged even when the fix_section_name function was used
to fix non-section names.
2018-07-17 11:52:15 +03:00
Markus Mäkelä
4a0ace2a72
Use module-style parameters with monitors
The common monitor parameters are now stored as module-style
parameters. This makes the error reporting as well as the type checks for
the parameters consistent with parameters declared by the modules.
2018-07-17 11:52:15 +03:00
Markus Mäkelä
f807c21242
Treat service parameters as module parameters
The same mechanism that is used for modules can be used for the
configuration of the core objects. This removes the need for the redundant
code that validates various values that is already present in the code
that modules use.
2018-07-17 11:52:14 +03:00
Markus Mäkelä
e2fb0093b1
Merge branch '2.2' into develop 2018-07-12 19:38:40 +03:00
Markus Mäkelä
71c736faec
Initialize router parameters in service_alloc
By moving the router parameter initialization into service_alloc, the
creation of a new service can be simplified to a single function call.
2018-07-11 14:08:56 +03:00
Markus Mäkelä
81527894ee
Remove filter options
None of the filters used the options. The filter API version was already
incremented once for 2.3 so there's no need to increment it again.
2018-07-11 14:08:56 +03:00
Markus Mäkelä
cbb8c68770
Remove router_options
Relaced router_options with configuration parameters in the createInstance
router entry point. The same needs to be done for the filter API as barely
any filters use the feature.

Some routers (binlogrouter) still support router_options but using it is
deprecated. This had to be done as their use wasn't deprecated in 2.2.
2018-07-11 14:08:56 +03:00
Markus Mäkelä
b320217212
Remove configuration reloading
Removed the deprecated configuration reloading code. Added a entry into
the release notes that states this and the fact that it was deprecated in
2.2.
2018-07-11 14:08:54 +03:00
Markus Mäkelä
2df5763b6c
Add configuration exporting
The runtime configuration of a MaxScale can now be exported to a single
file. This allows modifications made via runtime configuration commands to
be "committed" for later use.
2018-07-07 09:28:50 +03:00
Johan Wikman
f2b8487577 MXS-1624 Add configuration parameter
With the global configuration parameter 'query_classifier_cache'
the query classification cache can be turned on. At the moment it
does not matter what value it has; its presence simply enables the
caching.

Eventually you will be able to specify how much memory the cache
is allowed to consume.
2018-07-06 12:12:31 +03:00
Johan Wikman
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
Markus Mäkelä
396f5d96c2
Merge branch '2.2' into develop 2018-06-20 14:43:03 +03:00
Markus Mäkelä
28ae1bf24e
MXS-1932: Ignore hidden files in maxscale.cnf.d
All files that are hidden (i.e. start with a period) are now ignored by
the configuration file processing.
2018-06-20 14:41:55 +03:00
Johan Wikman
6dd479104f MXS-421 Enable the turning on of events 2018-06-18 11:32:50 +03:00
Johan Wikman
ee03ffd7db MXS-1917 Replace HASHTABLE with std::set 2018-06-12 17:32:01 +03:00
Johan Wikman
69b19d1473 Remove unnecessary includes of hashtable.h
And add where necessary.
2018-06-12 11:02:29 +03:00
Markus Mäkelä
96ed651466
Merge branch '2.2' into develop 2018-06-11 11:28:36 +03:00
Markus Mäkelä
1a24f0a956
Merge branch '2.1' into 2.2 2018-06-11 10:36:57 +03:00
Markus Mäkelä
70fdd0fc17
Merge branch '2.2' into develop 2018-06-06 08:56:31 +03:00
Markus Mäkelä
f2b2951c99
Track the number of performed monitoring intervals
Tracking how many times the monitor has performed its monitoring allows
the test framework to consistently wait for an event instead of waiting
for a hard-coded time period. The MaxCtrl `api get` command can be used to
easily extract the numeric value.
2018-06-06 08:46:46 +03:00
Markus Mäkelä
4a3216d483
Merge branch '2.2' into develop 2018-06-04 16:00:19 +03:00
Markus Mäkelä
306beb05cd
MXS-1899: Allow generated [maxscale] sections
The generated configuration file contains a [maxscale] section which
should not be treated as an error.
2018-06-04 15:17:48 +03:00
Johan Wikman
af9beecaef MXS-1775 Handle config param disk_space_check_interval 2018-06-01 13:48:15 +03:00
Johan Wikman
938865de3d MXS-1775 Allow the setting of disk_space_threshold
Now disk_space_threshold can be set on servers and monitors.
2018-06-01 13:48:15 +03:00
Johan Wikman
cb8cd4be3d MXS-1775 Add helper function for parsing disk_space_threshold
The function will be used by the functions

    server_set_disk_space_threshold() and
    monitor_set_disk_space_threshold()

that will be introduced.
2018-06-01 13:48:15 +03:00
Markus Mäkelä
16d2ff9564
Set read and execute permissions for all paths
If a path requires read or execute permission, it is granted to all. This
keeps path parameters in line with other directories that MaxScale
creates.
2018-05-28 10:32:16 +03:00
Markus Mäkelä
40b31621c8
Merge branch '2.2' into develop 2018-05-25 12:15:58 +03:00
Markus Mäkelä
a705130708
MXS-1882: Make [maxscale] sections in sub-configs an error
Defining the [maxscale] section in a configuration file that is not the
root configuration file is now treated as an error instead of silently
ignored.
2018-05-24 13:01:57 +03:00
Johan Wikman
7e9062f20f Merge branch '2.2' into develop 2018-05-16 09:31:13 +03:00
Markus Mäkelä
df1f3ca7c6
Fix monitor_interval log message
The message had the parameter and monitor names the wrong way around.
2018-05-15 10:15:32 +03:00
Esa Korhonen
12035289f4 Remove server authenticator options
Was unused. A warning is printed if the parameter is defined. Any value is ignored.
2018-05-08 14:18:00 +03:00
Johan Wikman
851cefefc6 MXS-1848 monitor_[alloc|free]() -> monitor_[create|destroy]
As these will call the createInstance and destroyInstance functions
of the monitor, they are more appropriately named like this.
2018-05-07 14:08:36 +03:00
Johan Wikman
510eb7ec7c MXS-1848 Change monitorCamelCase to monitor_snake_case 2018-05-07 14:08:36 +03:00
Niclas Antti
62a3dd664d MXS-1755 Warn about unknown global configuration entries.
MXS_WARNING for unknown entries. Later to become an error (in 2.4).
2018-04-27 18:41:01 +03:00
Markus Mäkelä
fd2d22eba6
Allow module level parameter deprecation
Parameter deprecation on the module level means that the parameter should
no longer be used but using it will not cause an error. If a deprecated
parameter is used, it will be removed from the configuration.
2018-04-27 12:32:33 +03:00
Markus Mäkelä
df1fc49ac3
Add config parameter removal
Config parameters can now be removed. Grouped the related functions closer
to each other in config.cc.
2018-04-27 12:00:33 +03:00
Esa Korhonen
5d010ff712 Cleanup SERVER struct
Removed one unused field. Rearranged others, clarified comments.
2018-04-27 10:48:56 +03:00
Markus Mäkelä
f4bdf3012d
Merge branch '2.2' into develop 2018-04-23 14:20:32 +03:00
Markus Mäkelä
d67320e06a
Fix more GCC 8 build failures
Fixed string truncation warnings by reducing max parameter lengths by one
where applicable. The binlogrouter filename lengths are slightly different
so using memcpy to work around the warnings is an adequate "solution"
until the root of the problem is solved.

Removed unnecessary CMake policy settings from qc_sqlite. Adding a
self-dependency on the source file of an external project has no effect
and only caused warnings to be logged.
2018-04-23 14:02:54 +03:00
Johan Wikman
c011b22046 MXS-1754 Enable workers other than routing workers
The maximum number of workers and routing workers are now
hardwired to 128 and 100, respectively. It is still so that
all workers must be created at startup and destroyed at
shutdown, creating/destorying workers at runtime is not
possible.
2018-04-23 13:58:00 +03:00
Markus Mäkelä
2c6d27d600
MXS-1815: Use all available CPUs with threads=auto
The documentation stated that all CPUs would be used when threads=auto was
used. In reality the behavior was the same as was with 2.0 (number of CPUs
minus one).
2018-04-20 22:26:32 +03:00