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.
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.
The test environment isn't always pristine after a test run so for the
sake of being able to actually test what we're attempting to test, we
should ignore duplicate databases for the time being.
The long-term fix is detect when a test doesn't clean up after itself.
The relay master status was assigned to a server based on the last known
replication status of the slaves that have at some point replicated from
it. This can cause false positives and the relay master status is assigned
to servers that have never been observed to act as relay masters.
The master failure verification would not work if the slaves did not have
a state change since MaxScale had started. This can be fixed by treating
the startup of MaxScale as an event of sorts.
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.
Some of the older tests expected results that didn't make much sense. The
mxs1643_extra_events test should expect the master to devolve into the
Running state when it is set into read-only. This is understandable as a
set of servers consisting only of slaves is rather disorienting.
In mxs1678_relay_master breaking the replication of the relay master
devolves it into the Running state as well as all slaves replicating from
it. This is a better result as in a real-life scenario only the valid and
up-to-date slaves would be used.
The master validity check now checks if the master is down. This requires
that the slave status is assigned even if no master is available.
The failover precondition is also fulfilled as long as one valid promotion
candidate is found. Previously a slave that didn't use GTID replication
appeared to prevent failover.
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.
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.
The auto_failover is a more reliable solution and should be used instead. Several
unused parameters were removed, although they can still be defined in the config
file. Updated documentation on the relevant parts.
The process of stopping a service will not prevent new connections from
being created. The documentation needs to be extended so that the meaning
of `accepted` is explicitly and clearly stated.
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.
To prepare the router's for the eventual removal of the router_options
parameter, the API option arguments should not be used. The parameters can
be substituted by tokenizing the value of the parameter that is still
stored as a part of the service.
If a router parameter has no default value, the previous value would be
returned as an empty string. A debug assertion would be triggered when a
parameter of this type was altered.
When a new router parameter is encountered and the alteration fails, the
modified value in the service need to be removed. Previously, the new
value would have been stored in the service with an empty value which
would have caused problems.
The schemarouter now also uses versioned configurations implemented by
shared pointers to configuration objects. Moved all the configuration
management into the Config class. Removed router options from
schemarouter.
The mxs::strtok function splits a string into a vector of strings based on
a set of delimiters. The function makes it easier to iterate over a set of
values given as a delimited string.
Extended the test to cover modifications to readconnroute as well as do
checks on detection of invalid parameters.
Also allowed modifications to router_options at runtime.
Readconnroute can now be configured at runtime. The changes to
configuration processing allow the removal of router_options now that the
parameters are parsed inside the router.