Drop the requirement that GTID based replication is used for
the BinLog Galera "failover" mechanism. There is no reason for
that restriction; it works just as well with file+position based
replication.
The binlogrouter uses buffers across worker threads which is no longer OK
in 2.3. The correct solution would be to store data in something other
than a GWBUF (e.g. std::vector) and protect the sharing with a mutex. The
current solution simply works around the assertions by using macros
instead of functions.
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.
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.