MXS-1545: handling of slave file EOF refactoring.
Some slave/router state are now checked before any WARN/ERROR messages
about slave file EOF.
The missing “next_file” is always logged with warn.
The usage of the router_options has become optional in 2.1. This means
that the binlogrouter should not fail to start if no router_options are
defined.
Also lowered the error about master.ini to a warning as it is expected to
happen on a fresh installation.
The new `ssl_verify_peer_certificate` parameter controls whether the peer
certificate is verified. This allows self-signed certificates to be
properly used with MaxScale.
The transaction safety was checked even if master GTID registration was
disabled. This always caused a failure when the router was started without
the transaction safety parameter.
As transaction safety is required by the GTID registration, it is not very
helpful to refuse to start if an invalid set of options is detected. To
make usage of the master GTID registration easier, the transaction safety
is also automatically enabled.
The documentation stated that the binlogrouter would use the cache
directory to store the binary log files. In reality, there was no default
value and the service would fail to start without a binlogdir parameter.
The router now uses the data directory (/var/lib/maxscale/) to store the
binary logs.
Set the default value of mariadb10-compatibility to true. This is in line
with the fact that most installations should use the router with a MariaDB
10.0 server or newer.
Cleaned up the MaxScale version of the mysql.h header by removing all
unused includes. This revealed a large amount of dependencies on these
removed includes in other files which needed to be fixed.
Also sorted all includes in changed files by type and alphabetical
order. Removed explicit revision history from modified files.
Binlog server: force fake Client DCB close in errorReply. This fixes an
issue when START SLAVE, with new config, is called after a previous one
with errors.
MXS-1156: MASTER_CONNECT_RETRY is a new option for CHANGE MASTER TO.
The ‘connect_retry’, ‘master_retry_count’ options are now in use for
both service and
router_options.
The internal connections of the binlogrouter should be closed in the same
thread that created them. This should be the "main" thread, i.e. thread 0,
that starts the original binlogrouter service.
Routine blr_handle_missing_files() is called by
blr_handle_fake_rotate().
Field ‘filestem’ is updated in order to avoid wrong file name creation.
Additionally router is not creating any missing filenames if
router->binlog_name is empty (no previous binlog files)
A new option ‘slave_hostname’ allows the setting of hostname in
COM_REGISTER_SLAVE.
SHOW SLAVES HOSTS; in master server can show the hostname set in binlog
router:
MariaDB [(none)]> SHOW SLAVE HOSTS;
+-----------+-----------------------------+------+-----------+
| Server_id | Host | Port | Master_id |
+-----------+-----------------------------+------+-----------+
| 93 | maxscale-blr-1.mydomain.net | 8808 | 10124 |
+-----------+-----------------------------+------+-----------+
MASTER_USE_GTID=Slave_pos is now handled by CHANGE MASTER TO
If mariadb10_master_gtid is On
MASTER_LOG_FILE is no longer required, only MASTER_USE_GTID=Slave_pos
Slave_pos must be set before to empty value or request value:
set @@global.gtid_slave_pos = '0-10116-194';
Files are saved in GTID repo at creation time: this allows to show
files without transactions via SHOW [FULL] BINARY LOGS
The FULL keywords add domain_id and server id to the output as file
prefix: 0/10122/mysql-bin.000080
Saving GTID components into gtid_maps storage will allow to create a
hiearchical binlog cache dir.
Empty GTID for master registration can be specified with SET
@@global.gtid_slave_pos = ‘’
New option ‘mariadb10_master_gtid’ in use.
Only MariaDB 10 Slaves with GTID request can register if the option is
set.
When receiving a Master reply to a GTID request and the GTID_LIST is
seen, an IGNORABLE event could be written at the end of file if
GTID_LIST next_pos is beyond that EOF
New routine blr_handle_fake_gtid_list added for fake GTID_LIST_EVENT.
blr_file_append O_APPEND is set only if mariadb10_master_gtid is not
set.
blr_file_append() routine could change name in next commits
The “mariadb_gtid” parameter is no longer available:
“mariadb10_slave_gtid” is the new one.
Another parameter “mariadb10_master_gtid” enable GTID registration.
The latter set to On forces option “mariadb10_slave_gtid” to be On
The `user`, `password`, `version_string` and `weightby` values should be
allocated as a part of the service structure. This allows them to be
modified at runtime without having to worry about memory allocation
problems.
Although this removes the problem of reallocation, it still does not make
the updating of the strings thread-safe. This can cause invalid values to
be read from the service strings.
All routers except the binlogrouter now fully implement the JSON
diagnostic entry point. The binlogrouter needs to be handled in a separate
commit as it produces a large amount of diagnostic output.