50 Commits

Author SHA1 Message Date
MassimilianoPinto
c239477630 MXS-1387: checking slave connection in COM_BINLOG_DUMP phase
MXS-1387: checking slave connection in COM_BINLOG_DUMP phase
2017-09-06 15:09:50 +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
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
MassimilianoPinto
8927298abe MXS-1075: Avoid loops when missing binlog file is detected.
MXS-1075: Avoid loops when missing binlog file is detected.
2017-08-24 16:03:30 +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
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
Markus Mäkelä
26bf342e6b Merge branch '2.1' into develop 2017-07-24 12:37:25 +03:00
Markus Mäkelä
f76e4cd61d Fix GCC 7 and OpenSSL 1.1 build failures
Fedora 26 and Debian 9 have both GCC 7 and OpenSSL 1.1. These fixes add
support for the newer versions of these libraries.
2017-07-24 10:38:47 +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
c00d829d56 MXS-1266: add MariaDB GTID fields in SHOW SLAVE STATUS
MXS-1266: add MariaDB GTID fields in SHOW SLAVE STATUS
2017-06-08 17:35:01 +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
362824579d MXS-1266: Standalone events in transaction (no COMMIT event) are now handled
Standalone events in transaction (no COMMIT event) are now handled:

the GTID is saved to gtid_maps storage.

Transaction detection assumes there is only one query_event after GTID
event with MARIADB_FL_STANDALONE flag set.
2017-05-19 11:43:43 +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
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
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
MassimilianoPinto
f13410bae9 MXS-1209: added SELECT @@GLOBAL.gtid_domain_id for Master GTID registration
Master GTID registration: added first step: support for “SELECT
@@GLOBAL.gtid_domain_id”
2017-05-03 14:46:41 +02:00
MassimilianoPinto
e0a12820b6 Binlogserver sends GTID_LIST Fake Event when a MariaDB 10 slave connects with GTID
Now sending GTID_LIST Fake Event when a MariaDB10 Slave connects with
GTID
2017-04-06 09:04:19 +02:00
MassimilianoPinto
a236b14eef MXS-1075: Sqlite db for GTID - file, pos mapping
Use sqlite3 database instead of hash tables for GTID - file, pos mapping
2017-03-28 10:23:09 +02:00
MassimilianoPinto
9388dff7cf Merge branch 'develop' into MXS-1075 2017-03-15 18:12:00 +01:00
MassimilianoPinto
573615889b Binlog Server doesn't ask for any maxwell query if the option is not set
If ‘maxwell-compatibility’ option is not set, no SET/SELECT are sent to
master during slave registration phase
2017-03-14 09:28:04 +01:00
MassimilianoPinto
4b472d9a13 MXS-1075: file field added to MARIADB_GTID_INFO
MXS-1075: missing field added to MARIADB_GTID_INFO
2017-03-08 09:29:21 +01:00
MassimilianoPinto
4e8bf1106b MXS-1075: MariaDB 10 Slave registration with GTID
New SQL commands are handled for MariaDB 10 slave registration with GTID
2017-03-06 08:56:26 +01:00
MassimilianoPinto
1061344de9 MXS-1075: save all received MariaDB GTIds
The GTID saving, which will allow slave to connect with GTID, is done
only with transaction_safety = on
2017-03-02 13:07:21 +01:00
MassimilianoPinto
054ddcb3dd MXS-1075: pending_transaction struct added
New pending_transaction added and master_transaction_t values are now
used in all files
2017-02-28 13:50:38 +01:00
Markus Mäkelä
68f99ae305 Remove unused DCB callback code
The highwater and lowwater callbacks were never registered for the client
DCBs in the binlogrouter.

The DCB hangup callbacks were never called by the core and were replaced
with fake hangup events in an earlier version.
2017-02-27 09:25:15 +02:00
MassimilianoPinto
446f65a9cf MXS-1142: maxbinlogcheck to remove transaction from binlog
maxbinlogcheck with new -T $pos option can find the BEGIN of
transaction where $pos belongs to and then replace all events in
between with IGNORABLE events
2017-02-16 17:33:27 +01:00
MassimilianoPinto
755a3601ec MXS-1141: maxbinlogcheck to replace an event with ignorable event
maxbinlogcheck utility can replace an event at pos with an ignorable
event

New option is -R, —replace

-R $pos

The -R needs -f as file will be modified
2017-02-16 12:23:26 +01:00
MassimilianoPinto
a0b599730c Detect and store MariaDB GTID
If Binlog Server is running with MariaDB 10 compatibility then the
found GTID is stored in router->mariadb_gtid
2017-02-15 08:29:38 +01:00
Johan Wikman
71707c8505 Merge branch '2.1' into develop 2017-02-15 08:48:36 +02:00
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Adam Szkoda
825782799f Zendesk's Maxwell Compatibility (#119)
* Binlog router: Introduce maxwell_compatibility flag

* Binlog router: Handle 'server vars' query

This is a step towards using MaxScale with Zendesk's Maxwell.

* Binlog router: Handle results charset query

* Binlog router: Handle sql_mode query

* Binlog router: Handle server_id query

* Binlog router: Handle 'binlog vars' queries

* Binlog router: Handle @@lower_case_table_names query

* Binlog router: Handle @@global.binlog_checksum query

* Binlog router: DRY Maxwell SQL queries
2017-02-13 16:40:01 +01:00
Esa Korhonen
1f9b18e3bc Split secrets.h to public and core + miscellaneous cleanup
Also, changed some function names to this_style from thisStyle. More of
this in later commits.
2017-01-27 15:33:52 +02:00
Esa Korhonen
74225daf46 Remove memlog and rdtsc
Neither of these were actively used, so they and any associated tests
were removed.
2017-01-26 13:16:51 +02:00
Esa Korhonen
fb771c8a2e Rename public types and constants in session.h
Preparing to split session.h into module and core sections.
2017-01-17 16:30:14 +02:00
Markus Mäkelä
a48be9badf Format router modules
Formatted router modules with Astyle.
2017-01-17 14:48:43 +02:00
Markus Mäkelä
2cabcea211 Add definitions of MXS_MODULE_NAME to all modules
All modules now declare a name for the module. This is name is added as a
prefix to all messages logged by a module. The prefix should help
determine which part of the system logs a message.
2017-01-16 11:28:34 +02:00
Markus Mäkelä
c06a95ff92 Use module parameters in binlogrouter
The binlogrouter accepts all router options also as parameters.
2017-01-10 16:52:29 +02:00
MassimilianoPinto
162ae04d20 MXS-867: Binlog server encryption key has same format as MariaDB key file
Default algorithm is now AES_CBC.
The MariaDB 10.1 key file cannot be read as it might contain more than
1 rows.
2016-12-12 14:01:54 +01:00
MassimilianoPinto
9444ded6da Binlog encryption is now working with events larger than 16MBytes
Events larger than 16MBytes are now encrypted when being saved.

Some changes to binlog event details report and maxbinlogcheck supports
-H option for replication header display
2016-12-07 12:17:22 +01:00
MassimilianoPinto
b2e8a2d8c5 Develop merge
Develop merge:
this includes the new handling of events larger than 16MBytes
2016-12-05 16:38:48 +01:00
Markus Makela
f5eb4e21dc Add more comments and clean up code
The binlog event processing code is now better commented and is slightly
easier to read.
2016-12-05 17:08:59 +02:00
Markus Makela
2f082cb7fb Store large events in memory
Storing the large events in memory allows checksum calculations to be done
in one step. This also makes the encryption of events easier as they
require the complete event in memory.
2016-12-05 17:08:59 +02:00
Johan Wikman
aef6c7b099 Make directory name equal to the library name
* avro -> avrorouter
* binlog -> binlogrouter
2016-12-01 15:23:42 +02:00