When default parameters are loaded, the type and module name are
added. This helps object serialization and allows all the code to expect
that all the parameters needed to create an object are always present.
By passing strings instead of const char pointers to the task control
functions, we can safely make copies of them knowing that the contents
won't disappear.
The last server wasn't removed as the set of relationships was empty. In
addition to this, changes to relationships via the relations endpoint
wasn't reflected by the monitor parameters.
If a monitor was created at runtime, it was missing some parameters that
were assumed to be always present. In addition to that, the parameters
weren't validated against the list of common and module parameters.
Since the monitors always reconstruct the server list, the new servers can
be stored as a parameter. To make this possible, the
server_relationship_to_parameter helper function is needed.
This commit fixes the MaxCtrl test suite failures but does not fix the
failures in the REST API test suite.
Reactivating monitors shouldn't be done as it's simpler to actually
destroy and create a new one. The performance of reactivation is
insignificant compared to the possible inconsistency problems it allows.
Storing all the runtime errors makes it possible to return all of them
them via the REST API. MaxAdmin will still only show the latest error but
MaxCtrl will now show all errors if more than one error occurs.
Added an overload to execute_concurrently that takes an std::function as a
parameter and added a const version of operator* for rworker_local. Also
removed the std::move of the return value in rworker_local::values as it
can prevent RVO from taking place.
Alterations to monitors are now done with all changes present in the first
call to configure. This fixes the case where two parameters depended on
each other and one would get configured before the other.
Uncrustify always forced insertion of tabs which led to mangled formatting
of the parameters. Placing each part on a separate line seems to work
better and produce a more readable output.
The functions are now in MonitorServer. Disk space can only be checked
during specific ticks. If a server misses a tick (e.g. is down) it will
be checked after disk_space_check_interval has passed.
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.
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.
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.
Given the following query:
PREPARE ps FROM 'PREPARE ps2 FROM \'SELECT 1\'';
The debug assertion is hit even though this is valid, albeit unsupported,
SQL. An optimization would be to ignore the query if the prepared
statement type is another prepared statement.
When a single GWBUF was split into two with gwbuf_split, the new GWBUF
would point to the start of the shared data and the old one to the
end. Data-wise, this is fine but as the parsing info for queries is stored
in the shared buffer it causes problems when multiple packets get read in
one network payload. The end result would be that only the first query in
the lot would get parsed and the rest would get the same classification as
the first one.
To properly fix this without the need to deep clone the buffer would
require a reorganization of the buffer mechanism in MaxScale.
This commit alone doesn't fix the queued query routing problems in
readwritesplit. The commit from 2.2 which fixes the ordering problems with
queued queries is also required for a fully functional queued query
mechanism.
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.
Previously, runtime monitor modifications could directly alter monitor fields,
which could leave the text-form parameters and reality out-of-sync. Also,
the configure-function was not called for the entire monitor-object, only the
module-implementation.
Now, all modifications go through the overridden configure-function, which calls the
base-class function. As most configuration changes are given in text-form, this
removes the need for specific setters. The only exceptions are the server add/remove
operations, which must modify the text-form serverlist.
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.
If a DCB was closed and a hangup event was sent to it via
dcb_hangup_foreach shortly after it was closed, the DCB would still
receive it even if it was closed. To prevent this, events must only be
delivered to DCBs if they haven't been closed.