The monitor now continuously updates a list of enabled server events. When
promoting a new master in failover/switchover, only events that were enabled
on the previous master are enabled on the new. This avoids enabling events
that may have been disabled on the master yet stayed in the SLAVESIDE_DISABLED-
state on the slave.
In the case of reset-replication command, events on the new master are only
enabled if the monitor had a master when the command was launched. Otherwise
all events remain disabled.
Keeping the parser state internal to a subclass makes the code more
readable and allows the removal of most parameters. It also removes the
need to return iterator ranges from the tokenization function thus making
the Token class obsolete.
Unit testing benefits from this as well as it more closely resembles usage
in the wild as more of the code can be run without a live system.
The tokenization is somewhat crude but given the small amount of token
types it is acceptably efficient while still maintaining readability. The
parsing is quite simple to implement as a sort of a recursive descent
parser and is a lot more readable that the old state machine
implementation.
Extended the unit test to check that all supported hint types are parsed
correctly. The stack mechanism isn't fully covered by the unit test and it
needs to be added once the stack mechanism uses STL containers.
The code extracts comments from a query. All three comment types are
supported and the double dash comments properly handle invalid input
(fixes MXS-2289).
The code uses iterators to access to the query and returns a list of
iterator pairs as start and end markers to comments. This makes testing
easier as the input and output can be passed as an std::string.
When the SERVER_BEING_DRAINED bit is on, if the number of connections
to the server is 0, the state is reported as "Drained", otherwise as
"Being Drained".
Since the current node id can be obtained using the function gtmnid()
the queries for finding out whether a node is in the quorum and whether
it is softfailed can be made simpler.
When a softfailed node is finally revoked, it will appear as the
single node in a functioning Clustrix cluster. To ensure that the
Clustrix monitor will not stick to that node, if the node that is
used as hub is softfailed, it is immediately replaced with another
node.
The config parameter ordering depends on which end of the linked list the
parameters are added. The test should be re-enabled once parameter handling
has been refactored.
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);