111 Commits

Author SHA1 Message Date
Markus Mäkelä
ad15f4d4be
Fix binlogrouter build failures with GCC 8
GCC 8 appears to have improved the snprintf truncation detection which
revealed problems in the binlogrouter.
2018-04-17 21:55:47 +03:00
Markus Mäkelä
47184ea46d Fix build failure on Ubuntu 17.10
The sprintf calls failed due to a warning about possible buffer
overflow. Curiously enough, the same warnings do appear on Fedora 26 but
only when the calls are changed to snprintf.
2018-01-17 14:06:19 +02:00
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
d4c0d74ab4 MXS-1530: check ANNOTATE_ROWS flag in connecting slave
MXS-1530: check ANNOTATE_ROWS flag in connecting slave.

In MariaDB 10.2.4 replicate_annotate_row_events and
binlog_annotate_row_events have default to ON: this change checks
whether the connecting slave is not has ANNOTATE_ROWS in
blr_slave_binlog_dump(), those ANNOTATE_ROWS events can be sent or not
to the slave.
2017-11-30 16:34:24 +01:00
MassimilianoPinto
36129466e5 MXS-1545: fix file pointer reuse in blr_open_binlog
When binlog storage is TREE the check for existing BLFILE should use
gtid info in addition to strcmp
2017-11-30 09:47:02 +01:00
MassimilianoPinto
aa35b202ec Merge 2.1 into 2.2
Merge 2.1 into 2.2
2017-11-30 09:15:42 +01:00
MassimilianoPinto
8a10b72e4d Merge 2.1 in 2.2
Merge 2.1 in 2.2
2017-11-29 11:30:33 +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
Esa Korhonen
8966f36b1d MXS-1545: Fix remaining compile issues 2017-11-27 16:24:05 +02:00
MassimilianoPinto
7f6b40e710 MXS-1545: Fix sequence number for blr_slave_abort_dump_request()
blr_slave_abort_dump_request() is now called with right slave->seqno
value.

Added error messaged replication stop for GTID maps reading failure
2017-11-27 10:02:26 +01:00
MassimilianoPinto
e9cf0c0f86 MXS-1545: use GTID file info in blr_binlog_file_exists
MXS-1545: use GTID file info in blr_binlog_file_exists instead of log
filename
2017-11-27 09:51:07 +01:00
Markus Mäkelä
3a78b716b8 Merge branch '2.2' into 2.2-mrm 2017-10-30 11:06:34 +02:00
Markus Mäkelä
a971aa25da Merge branch '2.1' into 2.2 2017-10-30 11:01:19 +02:00
MassimilianoPinto
d9bd977c35 MXS-1499: Add missing fields to SHOW ALL SLAVES STATUS
Now SHOW ALL SLAVES STATUS reports new fields:

Retried_transactions;
Max_relay_log_size,
Executed_log_entries,
Slave_received_heartbeats,
Slave_heartbeat_period,
Gtid_Slave_Pos"
2017-10-27 14:07:53 +02:00
MassimilianoPinto
f805716700 MXS-1497: Don't skip events with LOG_EVENT_IGNORABLE_F flag
Currently binlog server doesn't send to slaves these event types:
- MARIADB10_START_ENCRYPTION_EVENT
- IGNORABLE_EVENT

It also skips events with LOG_EVENT_IGNORABLE_F flag.

This modification allows sending events with that flag.
2017-10-26 11:32:06 +02:00
MassimilianoPinto
b1f62ec1af MXS-1488: Added SHOW STATUS LIKE 'slave_received_heartbeats'
Add support for show status like 'slave_received_heartbeats' in
binlogserver.
2017-10-25 15:11:07 +02:00
Markus Mäkelä
1b6e5baa56 Fix GCC7 warnings in binlogrouter
GCC7 reported possible destination buffer overflow in binlogrouter.
2017-10-12 12:29:43 +03:00
MassimilianoPinto
69cddb2695 MXS-1466: Add support for new variables: @@log_bin, @@max_connections, @@gtid_strict_mode etc
MXS-1466: Add support for new variables: @log_bin, @@max_connections,
@@gtid_strict_mode etc
2017-10-09 18:57:23 +02:00
Markus Mäkelä
75d298693c Fix GCC7 warnings in binlogrouter
GCC7 reported possible destination buffer overflow in binlogrouter.
2017-10-06 01:11:00 +03:00
Markus Mäkelä
bd39284f9c Merge branch '2.1' into 2.2 2017-10-03 14:30:06 +03: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
MassimilianoPinto
825e1478a1 MXS-1423: CHANGE MASTER TO tests with GTID option set
MXS-1423: CHANGE MASTER TO tests with GTID option set
2017-09-20 10:44:19 +02:00
MassimilianoPinto
3df5e6f137 Fix CHANGE MASTER TO with binlog server state BLRM_UNCONFIGURED
Fix CHANGE MASTER TO with binlog server state BLRM_UNCONFIGURED
2017-09-13 15:51:35 +02:00
MassimilianoPinto
7e1e63aef6 The poll_fake_write_event() ins no longer needed after the blr_slave_fake_rotate() call
Also removed some useless branches with ‘record’ pointer being not NULL
2017-09-13 13:57:56 +02:00
Markus Mäkelä
0f3a13e6ac Remove unused binlogrouter variables
The unused variables cause compilation to fail.
2017-09-12 22:32:40 +03:00
MassimilianoPinto
43d5f67a76 MXS-1383: fix for some change master to MASTER_LOG_FILE, POS settings that fail.
MXS-1383: fix for some change master to MASTER_LOG_FILE, POS settings
that fail.
2017-09-12 14:33:10 +02:00
MassimilianoPinto
6606983181 MXS-1383: abort slave connection if requested filename doesn't exist
MXS-1383: abort slave connection if requested filename doesn't exist
2017-09-08 18:43:01 +02:00
MassimilianoPinto
9617119aa9 Added blr_abort_change_master() routine
Added blr_abort_change_master() routine
2017-09-08 14:25:09 +02:00
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
795722506b MXS-1387: check if MariaDB 10 Slave has GTID request set.
MXS-1387: check if the connecting MariaDB 10 Slave has the GTID request
set and return error code which stops replication.
2017-09-06 11:13:15 +02:00
MassimilianoPinto
ff94a39038 Binlog server: fix closing slave connections called by MySQL admin connection
Binlog server: fix closing slave connections called by MySQL admin
connection
2017-09-04 15:23:24 +02:00
MassimilianoPinto
9230420872 The blr_master_close() is now called in the main worker thread.
The blr_master_close() is now called in the main worker thread by:
blr_stop_slave() and blr_stop_start_master()
2017-09-01 11:49:27 +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
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
MassimilianoPinto
1c4ae9f89a MXS-1344: Allow SET SQL_MODE='' statement from mysql monitor
When SET SQL_MODE='' statement is received from mysql monitor an OK
packet is sent.
2017-08-23 14:11:16 +02:00
MassimilianoPinto
965173dd88 MXS-1344: Binlog server reports real master id and its server id in monitor queries
MXS-1344: Binlog server reports the real master id in SHOW SLAVE STATUS
| SHOW ALL SLAVES STATUS, no matter the value of ‘master_id’ identity
parameter.

Binlog server report its own server id or the identity value of
‘master_id’ in MySQL monitor query SELECT @@global.server_id,
@@read_only;

Note: SELECT @@global.server_id (no other fields) still reports the
real master server id or the value set in ‘master_id’
2017-08-23 14:11:16 +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
b9588a89ac MXS-770: Removed support for PURGE BINARY LOGS without TO option.
PURGE BINARY LOGS doesn’t exist in MySQL/ MariaDB without options.

MaxScale binlog router supports only PURGE BINARY LOGS TO ‘file’
2017-08-08 10:02:48 +02:00
MassimilianoPinto
a9b0eb791b MXS-770: PURGE BINARY LOGS, minor improvements.
PURGE BINARY LOGS, minor improvements.
2017-08-07 10:26:28 +02:00
MassimilianoPinto
113d2ad87a MXS-770 Addition of PURGE BINARY LOGS feature
PURGE BINARY LOGS; deletes all files in binlogdir and GTID maps repo
but keeps current binlog file.

PURGE BINARY LOGS TO ‘file’; deletes all files in binlogdir and GTID
maps repo up to specified file.

mariadb10_slave_gtid=On option is needed in order to keep the list of
binlog files.
2017-08-07 10:26:28 +02:00
MassimilianoPinto
75b17151f3 Removed FULL option from SHOW BINARY LOGS
If option ‘binlog_structure’ is set to ‘tree’ then SHOW BINARY LOGS
displays the tree details of the binlog files.

MySQL [(none)]> SHOW BINARY LOGS;
+--------------------------+-----------+
| Log_name                 | File_size |
+--------------------------+-----------+
| 0/10122/mysql-bin.000117 |      1167 |
| 0/10122/mysql-bin.000118 |       652 |
| 0/10124/foo-bin.000016   |      5082 |
| 0/10124/foo-bin.000017   |       491 |
+--------------------------+-----------+

With option set to ‘flat’ (which is the default) the output contains
only
names:

MySQL [(none)]> SHOW BINARY LOGS;
+------------------+-----------+
| Log_name         | File_size |
+------------------+-----------+
| mysql-bin.000110 |       425 |
| mysql-bin.000111 |     10409 |
| mysql-bin.000112 |      9659 |
+------------------+-----------+
2017-08-04 10:08:11 +02:00
MassimilianoPinto
ae5eb004fe SHOW [FULL] BINARY LOGS is now able to report the same log file in use with different server_ids
SHOW [FULL] BINARY LOGS is now able to report the same filename in use
with different server_ids: this can happen with binlog_structure=tree

example from SHOW FULL BINARY LOGS

0/10122/mysql-bin.000113
…
0/10122/mysql-bin.000116
…
0/5306/mysql-bin.000113

SHOW BINARY LOGS shows the same file twice:

mysql-bin.000113
…
mysql-bin.000116
…
mysql-bin.000113
2017-08-03 11:11:37 +02: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
0597b625d3 SHOW FULL BINARY LOGS reports domain_id/server_id prefix only if binlog_structure is TREE
SHOW FULL BINARY LOGS reports domain_id/server_id prefix only if
binlog_structure is TREE
2017-08-01 15:49:16 +02:00