107 Commits

Author SHA1 Message Date
MassimilianoPinto
574af7762d MXS-1545: handling of slave file EOF refactoring
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.
2017-12-01 14:02:02 +01:00
MassimilianoPinto
ba22e3b1db MXS-154: make gtid and file MARIADB_GTID_INFO fields static
gtid and file MARIADB_GTID_INFO fields are now a fixed size
2017-11-27 18:05:13 +01:00
Markus Mäkelä
a72956e2f3 Merge branch '2.1' into 2.2 2017-11-27 09:10:33 +02:00
Markus Mäkelä
7c21eb3ec4 Do not force router_options usage
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.
2017-11-24 14:50:07 +02:00
Markus Mäkelä
afcb708e6e Merge branch '2.1' into 2.2 2017-11-21 16:49:21 +02:00
Markus Mäkelä
63ae436bd5 MXS-1019: Make peer certificate verification configurable
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.
2017-11-14 16:51:34 +02:00
Markus Mäkelä
cbb6739e00 Always open the SQLite database in binlogrouter
The SQLite database was mistakenly opened only when master GTID
registration was used.
2017-11-08 18:41:14 +02:00
Markus Mäkelä
4bca9aa023 Fix and improve binlogrouter GTID option processing
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.
2017-11-07 09:24:18 +02:00
MassimilianoPinto
d6812b91a0 MXS-1485: MariaDB 10 GTID is always on for slave connections
MariaDB 10 GTID is always on for slave connections.
Remove mariadb10_slave_gtid option
2017-10-24 08:42:43 +02:00
MassimilianoPinto
65dc9e0d30 MXS-1484: set binlog storage to TREE mode
When mariadb10_master_gtid is on the storage of binlog file is
automatically set to TREE mode.
2017-10-23 13:57:56 +02:00
Markus Mäkelä
bd39284f9c Merge branch '2.1' into 2.2 2017-10-03 14:30:06 +03:00
Markus Mäkelä
1772cc9021 Move blr_set_checksum into blr.h
The function is used in two different files so it needs to be in the
header.
2017-10-02 10:47:27 +03:00
MassimilianoPinto
1827f042e8 MXS-1459: Assign binlog checksum value at startup
Binlog checksum default value is wrong if a slave connects with
checksum = NONE before master registration or master is not accessible
at startup
2017-09-29 18:57:09 +02:00
MassimilianoPinto
32709b3e46 MXS-1458: Mark backend server as inactive if router is not configured.
MXS-1458: Mark backend server as inactive if router is not configured.
2017-09-28 10:01:29 +02:00
Markus Mäkelä
895d950da0 Format all source files with Astyle
Formatted all source files Astyle.
2017-09-28 07:04:21 +03:00
Markus Mäkelä
45b78a795e Update binlogrouter defaults
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.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
3676dcebb1 MXS-1398: Clean up mysql.h header
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.
2017-09-14 15:30:43 +03:00
MassimilianoPinto
4c5f0d184c Binlog server: force fake Client DCB close in errorReply
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.
2017-09-04 15:23:24 +02:00
MassimilianoPinto
0a1608d90d Log proper message in errorReply when master state is BLRM_SLAVE_STOPPED
Log proper message in errorReply when master state is BLRM_SLAVE_STOPPED
2017-09-01 16:48:20 +02:00
MassimilianoPinto
e1efb91ea5 MXS-1156: MASTER_CONNECT_RETRY is a new option for CHANGE MASTER TO
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.
2017-08-31 11:01:03 +02:00
MassimilianoPinto
42833386f5 MXS-1156: added configuration entry point for connection retry parameters.
MXS-1156: added configuration entry points for connection retry
parameters.

Variable names have been also changed.
2017-08-31 11:01:03 +02:00
MassimilianoPinto
c91187d4de MXS-1156: added limit to master connect retry
MXS-1156: added limit to master connect retry
2017-08-31 11:01:03 +02:00
MassimilianoPinto
3c7a0014a9 MXS-1156: Store master_heartbeat_period in master.ini
MXS-1156: Store master_heartbeat_period in master.ini
2017-08-31 11:01:03 +02:00
MassimilianoPinto
0f5f9f8228 MXS-1156: Disable heartbeat if value is set to 0
MXS-1156: Disable heartbeat if value is set to 0.

A warning log is written in maxscale log file when heartbeat is not set.
2017-08-31 11:01:03 +02:00
MassimilianoPinto
5b2cfac3cb MXS-1156: Added new option MASTER_HEARTBEAT_PERIOD to CHANGE MASTER TO
MXS-1156: Added new option MASTER_HEARTBEAT_PERIOD to CHANGE MASTER TO
2017-08-31 11:01:03 +02:00
Markus Mäkelä
655f8b9170 Close binlogrouter connections in thread 0
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.
2017-08-21 20:30:36 +03:00
MassimilianoPinto
7c296d746f Binlog server: handle filestem in blr_handle_missing_files()
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)
2017-08-18 09:45:24 +02:00
Markus Mäkelä
71ca174313 Reset master DCB pointer if it is closed
If the master DBC is closed, the pointer should be set to NULL as it is
used to check whether the connection is still valid.
2017-08-17 15:04:37 +03:00
Johan Wikman
4798810f76 Merge branch '2.1' into develop 2017-08-14 10:36:34 +03:00
MassimilianoPinto
7da092843f MXS-1343: send hostname to master with COM_REGISTER_SLAVE
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 |
+-----------+-----------------------------+------+-----------+
2017-08-09 17:09:50 +02:00
MassimilianoPinto
7d8407ff22 Binlog Server doesn't start without last found GTID in the repo only if “mariadb10_master_gtid” option is On
Binlog Server doesn't start without last found GTID in the repo only if
“mariadb10_master_gtid” option is On
2017-08-02 11:56:32 +02:00
Markus Mäkelä
96b98845a2 Allow filters to be used with binlogrouter
Filters can now be used with the binlogrouter to modify the contents of
the binlog stream now that the correct function call is used.
2017-07-07 10:37:30 +03:00
MassimilianoPinto
2cb874e95f MXS-1266: Master GTID registration: MASTER_USE_GTID=Slave_pos
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';
2017-06-12 16:19:53 +02:00
MassimilianoPinto
23befe8380 Merge branch 'develop' into MXS-1266 2017-06-08 17:38:23 +02:00
MassimilianoPinto
887e511fc5 MXS-1266: cosmetic changes
MXS-1266: cosmetic changes
2017-06-08 14:00:36 +02:00
MassimilianoPinto
8f94b27fd5 MXS-1266: Allow save and read binlog files from a binlog cache directory tree
MXS-1266: Allow save and read binlog files from a binlog cache
directory tree
2017-06-07 08:56:52 +02:00
Johan Wikman
f546a17e77 Update change date of 2.2 2017-06-01 10:24:20 +03:00
MassimilianoPinto
f66623c382 MXS-1266: files are saved in GTID repo at creation time
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
2017-05-29 10:58:02 +02:00
MassimilianoPinto
6c86e1ef2f MXS-1266: saving GTID components into gtid_maps storage. part1
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 = ‘’
2017-05-19 10:23:35 +02:00
MassimilianoPinto
61ffd3e0f0 MXS-1209: Master GTID Registration, part1
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
2017-05-09 08:25:44 +02:00
MassimilianoPinto
63caab2ece MXS-1209: var name fix
var name fix
2017-05-07 12:19:31 +02:00
MassimilianoPinto
ab89685075 MXS-1209: added blr_handle_fake_gtid_list
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
2017-05-05 15:42:23 +02:00
MassimilianoPinto
1eaed91867 Merge branch 'develop' into MXS-1209 2017-05-05 15:10:04 +02:00
MassimilianoPinto
28e05d44ad Added mariadb10_slave_gtid and mariadb10_master_gtid options
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
2017-05-04 10:54:33 +02:00
Markus Mäkelä
e62be5034a Use constant sized arrays for some service strings
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.
2017-05-04 09:17:48 +03:00
Markus Mäkelä
fc887c7f5f MXS-1220: Add old router diagnostic interface
Added back the old diagnostic entry point to the router interface.
2017-05-04 09:17:42 +03:00
Markus Mäkelä
076599ee5e MXS-1220: Make the parameters of the diagnostic entry points const
The diagnostic entry points should not modify the state of the object
being diagnosed.
2017-05-04 09:14:03 +03:00
Markus Mäkelä
bc3cfe0221 MXS-1220: Fix memory leaks
Some of the JSON objects created in the diagnostic functions leaked
memory.
2017-05-04 09:14:03 +03:00
Markus Mäkelä
ec6f3d566b MXS-1220: Implement JSON diagnostics in binlogrouter
The binlogrouter now implements the JSON diagnistics entry point.
2017-05-04 09:12:16 +03:00
Markus Mäkelä
eb3ff1cc7b MXS-1220: Implement JSON diagnostics for most routers
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.
2017-05-04 09:12:15 +03:00