54 Commits

Author SHA1 Message Date
Markus Mäkelä
6bdd959f6c Reset client DCB pointer after closing it
The client DCB was not reset in one of the cases where it was closed.

Also fixed use of overlapping memory addresses in strcpy.
2017-08-17 15:04:37 +03:00
MassimilianoPinto
d5de149e32 Update GTID repository while receiving ROTATE events and check the current file exists.
Update GTID repository while receiving ROTATE events and check the
current file exists.
2017-08-02 17:32:07 +02:00
MassimilianoPinto
7913f0ddf1 Develop Merge
Develop Merge
2017-06-30 10:48:13 +02:00
Markus Mäkelä
809dea34e0 Fix overlap of router->binlog_name in blr_file_create
A call to strcpy was made in blr_file_create where the function was given
the same pointer as both parameters. To avoid this, the file name is now
copied to a local variable before the router variables are modified.
2017-06-30 11:07:18 +03:00
MassimilianoPinto
cb57e10761 Develop merge
Develop merge
2017-06-29 15:34:22 +02:00
Markus Mäkelä
5597db255b Add wrapper functions for buffer and original IV access
Added functions for accessing the buffer and original IV. This hides the
changes introduced in OpenSSL 1.1.
2017-06-29 15:55:44 +03:00
Markus Mäkelä
09fb336403 Abstract EVP cipher context creation
The EVP_CIPHER_CTX is now created inside a wrapper function to add support
for OpenSSL 1.1. Also fixed improper use of the EVP_CIPHER_CTX internals
in binlogrouter.
2017-06-29 15:55:44 +03:00
MassimilianoPinto
4d78aaa3d8 MXS-1266: blr_slave_gtid_request() the file in slave registration request is checked whether it exists or not
MXS-1266:
blr_slave_gtid_request() the file in slave registration request is
checked whether it exists or not and GTID file info could e set instead.

Also addded:

blr_handle_simple_select_stmt(): only mariadb10_gtid_domain is checked
for SELECT @@GLOBAL.gtid_domain_id slave request
blr_start_master_registration(): only router->mariadb10_compat is
checked before sending SELECT @@GLOBAL.gtid_domain_id to master
blr_file_create calls mxs_mkdir_all()
2017-06-12 17:26:37 +02: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
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
12c862a2c2 MXS-1266: saving GTID, part1: SQL statements review
Saving GTID: SQL statements review in  blr_load_last_mariadb_gtid and
blr_fetch_mariadb_gtid
2017-05-19 10:44:23 +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
2c346ffc1b MXS-1209: MariaDB GTID registration: handling of skipped binlog files from a Fake ROTATE_EVENT
MariaDB GTID Master registration:
creating missing binlog files (with 4 byes) between current one and the
filename coming from ROTATE_EVENT.

blr_slave_binlog_dump() is also checking possible empty files.
2017-05-12 17:18:38 +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
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
cb69b3cbca Merge branch 'develop' into MXS-1075 2017-03-09 15:08:04 +01:00
Markus Mäkelä
e1a1959bc2 Replace strerror_r with mxs_strerror
The mxs_strerror function requires no local buffer, thus making it simpler
and cleaner to use.
2017-03-09 09:36:57 +02:00
MassimilianoPinto
670150c1c9 MXS-1075: added blr_fetch_mariadb_gtid() routine
Added generic blr_fetch_mariadb_gtid() routine

inst->binlog_name is now stored into MARIADB_GTID_INFO struct. (it was
missing)
2017-03-08 09:06:10 +01:00
MassimilianoPinto
656a38096c Revert "MXS-1075: added blr_fetch_mariadb_gtid() routine"
This reverts commit b0afff73a1b9b1eacc617408d92d5117b7676f0e.
2017-03-08 08:57:59 +01:00
MassimilianoPinto
b0afff73a1 MXS-1075: added blr_fetch_mariadb_gtid() routine
Added generic blr_fetch_mariadb_gtid() routine

inst->binlog_name is now stored into MARIADB_GTID_INFO struct. (it was
missing)
2017-03-08 08:51:19 +01:00
MassimilianoPinto
0f9c169e7d Merge branch 'develop' into MXS-1075 2017-03-06 08:57:51 +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
Johan Wikman
b3e8ea9b5a Merge branch '2.1' into develop 2017-03-03 13:37:14 +02: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
Johan Wikman
7bcb60aaa6 MXS-1077: Add missing close 2017-03-01 10:47:20 +02: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
MassimilianoPinto
6fd025376c Missing NULL check
Missing NULL check added
2017-02-20 16:21:37 +01: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
49cc2b52e3 Merge branch '2.1.0' into 2.1 2017-02-15 08:44:55 +02:00
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Johan Wikman
0838401b32 Merge branch '2.1' into develop 2017-02-14 17:54:27 +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
Markus Mäkelä
acd66b4eb3 Fix compiler warnings
Added missing checks for return values of various function calls. Fixed
binlogrouter strerror_r usage and wrong buffer sizes.
2017-02-13 11:44:38 +02:00
Esa Korhonen
6e38276a20 Rename files, removing "gw"-prefix
Also gwdirs.h.in -> paths.h.in
2017-01-20 12:55:52 +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
83957a503c Binlog encryption check against openssl 1.0
AES_CTR routines are part of openssl 1.0.

If an old library is in use the AES_CTR cannot be specified for
encryption.

Additionally compilation is done without errors.
2017-01-04 15:15:40 +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