This only deactivates some of the more heavy-handed features. All files have
been formatted with the new settings, which seems to have only affected lines
which were not formatted before.
Changes to the ChangeMasterOptions made it non-trivial so it cannot be
safely memset anymore. The maxavrocheck was missing the linkage to the
maxscale-common library.
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.
If secondary masters are defined, MASTER_USE_GTID=Slave_pos must
be specified for the default master.
If MASTER_USE_GTID is specified, only Slave_pos is allowed as
value.
The variable storing the configuration index renamed from
'current_config' to 'config_index'.
In the code the same terminology is used as in the documentation.
"Default" is is used for referring to the default connections
(earlier "primary" was used) and the secondary connections are
referred to as "secondary" (earlier "alternative" was also used).
- When specifying a configuration, if it already exists use
the existing configuration as the default, thus allowing you
to change only a specific configuration value.
- When specifying a new alternative configuration, use the
primary (aka first) configuration as the base.
- If MASTER_HOST is changed on the primary (first, nameless)
configuration, then all configurations are erased.
- At "SLAVE START", always start from the first configuration.
If the replication fails using the current config, we retry
immediately using another config, without waiting anything at
all.
Only when we have unsuccessfully tried with all servers, will
we wait a while before starting again.
0 cannot be used to indicate failure as 0 will be the waiting
period if we switch to an alternative server.
Also fix some minor issues; failure to initialize all members
and inverted success-check.
Separating the reading of the config from the process of
applying it allows us to use configs around and later apply
them (e.g. when we decide its time to switch master server).
At save time, assert that the configuration as dispersed around
blr and as stored in the config object are identical.
Later its the state from the config object that will be saved.
Alternative masters can now be specified like
CHANGE MASTER TO ...
CHANGE MASTER ":2" TO ...
CHANGE MASTER ":3" TO ...
Now only the data is stored, but it is neither used nor
saved.
This function applies a change master config. Currently is
used from blr_handle_change_master(), and subsequently will
be used when BLR switches to an alternative master.
This type will be used for storing the configuration
specified with CHANGE MASTER at a point where it has been
verified, to the extent possible, that the provided options
are valid.
In order to make it visible that the types contain C++
members, the following types were renamed:
CHANGE_MASTER_OPTIONS -> ChangeMasterOptions
MASTER_SERVER_CNF -> MasterServerConfig
Functions where also changed to take const refs were appropriate.
In order support the possiblity for having multiple alternative
masters for the binlog server, we need to have multiple configs
around.
Originally the config values were stored as 'char *':s, which
would have made the lifetime management of the strings laborious
and error prone.
Now, the options are stored as std::string:s, which makes the
lifetime management a non-issue.
When receiving a command, such as
CHANGE MASTER TO MASTER_HOST = '127.0.0.1' ...
when the value is extracted, the quotes are removed before the value
is returned.
Firstly, BLR does not anyway anywhere enforce that quotes are present
where they should be and, secondly, BLR currently does de-quoting all
over the place and with this change, all those places can be simplified.
The master reconnection in the binlogrouter used the housekeeper
recursively. This is no longer supported and the delayed worker call
mechanism should be used in its stead.