262 Commits

Author SHA1 Message Date
Markus Mäkelä
d094e93209
Rename conflicting objects
The START_ENCRYPTION_EVENT is the name of an object that is exposed by the
Connector-C.
2018-06-08 12:18:13 +03:00
Marko
880db1353a Merge branch '2.2' into develop 2018-06-07 14:39:16 +03:00
Marko
0dd7448586 MXS-1709 Fix memory leaks in unit tests 2018-06-06 22:59:52 +03:00
Markus Mäkelä
5a3bbf0d15
Move binlog event processing into a separate file
This clarifies what parts of the router are specific to the binlogrouter
and what are common between the binlogrouter and avrorouter.

Ideally, the two modules would use the same infrastructure to handle the
processing of replication events. This is the first, albeit small, step
towards making the code in the binlogrouter the common infrastructure.
2018-05-28 10:32:18 +03:00
Markus Mäkelä
16d2ff9564
Set read and execute permissions for all paths
If a path requires read or execute permission, it is granted to all. This
keeps path parameters in line with other directories that MaxScale
creates.
2018-05-28 10:32:16 +03:00
Markus Mäkelä
77c713baa6
Remove manual revision notes and extra files
Removed the manually written revision notes that were in some files. Also
removed the README and STATUS files which were present.
2018-05-28 10:32:14 +03:00
Esa Korhonen
12035289f4 Remove server authenticator options
Was unused. A warning is printed if the parameter is defined. Any value is ignored.
2018-05-08 14:18:00 +03:00
Johan Wikman
1f6cc6db8a MXS-1840 Compile all routers as C++
Minimal changes, only what is needed in order to make it compile.
2018-05-07 14:06:22 +03:00
Esa Korhonen
5d010ff712 Cleanup SERVER struct
Removed one unused field. Rearranged others, clarified comments.
2018-04-27 10:48:56 +03:00
Esa Korhonen
caa964fa57 Merge branch '2.2' into develop 2018-04-24 13:57:50 +03:00
Johan Wikman
5cf56c7c0f Merge branch '2.1' into 2.2 2018-04-24 12:39:22 +03:00
Johan Wikman
bafe8f5eeb MXS-1618 Use right type for the return value of getopt_long
getopt_long returns an 'int'. If 'char' is used on a big-endian
platform you'll end up with an infinite loop.
2018-04-24 12:31:08 +03:00
Markus Mäkelä
f4bdf3012d
Merge branch '2.2' into develop 2018-04-23 14:20:32 +03:00
Markus Mäkelä
d67320e06a
Fix more GCC 8 build failures
Fixed string truncation warnings by reducing max parameter lengths by one
where applicable. The binlogrouter filename lengths are slightly different
so using memcpy to work around the warnings is an adequate "solution"
until the root of the problem is solved.

Removed unnecessary CMake policy settings from qc_sqlite. Adding a
self-dependency on the source file of an external project has no effect
and only caused warnings to be logged.
2018-04-23 14:02:54 +03:00
Markus Mäkelä
a2b78d40cf
Merge branch '2.2' into develop 2018-04-18 08:00:48 +03:00
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
Johan Wikman
b36f6faa7e MXS-1754 Reintroduce maxscale::Worker
Worker is now the base class of all workers. It has a message
queue and can be run in a thread of its own, or in the calling
thread. Worker can not be used as such, but a concrete worker
class must be derived from it. Currently there is only one
concrete class RoutingWorker.

There is some overlapping in functionality between Worker and
RoutingWorker, as there is e.g. a need for broadcasting a
message to all routing workers, but not to other workers.

Currently other workers can not be created as the array for
holding the pointers to the workers is exactly as large as
there will be RoutingWorkers. That will be changed so that
the maximum number of threads is hardwired to some ridiculous
value such as 128. That's the first step in the path towards
a situation where the number of worker threads can be changed
at runtime.
2018-04-16 14:53:08 +03:00
Markus Mäkelä
c70216390f
MXS-1506: Combine housekeeper task types
The tasks themselves now control whether they are executed again. To
compare it to the old system, oneshot tasks now return `false` and
repeating tasks return `true`.

Letting the housekeeper remove the tasks makes the code simpler and
removes the possibility of the task being removed while it is being
executed. It does introduce a deadlock possibility if a housekeeper
function is called inside a housekeeper task.
2018-04-10 15:29:30 +03:00
Markus Mäkelä
b33f464eea
MXS-1506: Make heartbeat reads atomic
The old hkheartbeat variable was changed to the mxs_clock() function that
simply wraps an atomic load of the variable. This allows it to be
correctly read by MaxScale as well as opening up the possibility of
converting the value load to a relaxed memory order read.

Renamed the header and associated macros. Removed inclusion of the
heartbeat header from the housekeeper header and added it to the files
that were missing it.
2018-04-10 15:29:29 +03:00
Markus Mäkelä
f54bbdf73b
Fix -Werror=format-truncation= warnings in blr_slave.c
The errors were caused by the fact that the server name
MAX_SERVER_NAME_LEN is 1024 bytes long whereas the buffer was 251 bytes.
2018-03-08 11:28:05 +02:00
Markus Mäkelä
3dfb972d87 Merge branch '2.1' into 2.2 2018-01-30 16:28:11 +02:00
Johan Wikman
6410b4f19a MXS-1633 Turn off collecting of sqlite3 memstats
According to customer reports collecting the statistics has a significant
impact on the performance. As we don't need that information we can just
as well turn off that.

Further, since maxscale-common now links to the sqlite3-library, no
module needs to do that explicitly.
2018-01-30 13:58:37 +02:00
Markus Mäkelä
c85f83fa2b Fix strcpy overlap in binlogrouter
The source and destination buffers could overlap which is why an
intermediate buffer is required.
2018-01-23 09:26:22 +02: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
Markus Mäkelä
200657e2f6 Pre-load binlogrouter modules for the test
The test loads multiple modules in one call so we have to pre-load them
one by one to make sure that they are all present regardless of the
locations where the individual modules were built.
2018-01-03 08:56:41 +02:00
Markus Mäkelä
f810ce9ea3 Fix binlogrouter unit test failure
The test used LD_LIBRARY_PATH to find the module instead of using an
explicit path.
2018-01-02 11:22:39 +02:00
Markus Mäkelä
8ef681d8cd Fix trivial memory leaks
Fixed trivial memory leaks detected by ASAN when running internal test
suite.
2017-12-27 11:56:39 +02:00
Markus Mäkelä
79afaa447e Merge branch '2.1' into 2.2 2017-12-12 13:23:02 +02:00
Markus Mäkelä
4b9bb9e65f Assign service pointer in BLR DCBs
The DCBs that were manually allocated by the binlogrouter were not
assigned the service pointers.
2017-12-12 08:47:02 +02:00
Markus Mäkelä
8084491d53 Fix build failure with GCC7
The format checks in GCC7 reported truncation in a snprintf call.
2017-12-04 09:56:50 +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
2217091019 MXS-1546: revert commit e16eee0cc3c6307f732c2e43d995d3c86cdd67a7
MXS-1546: revert commit e16eee0cc3c6307f732c2e43d995d3c86cdd67a7

This code is not necessary in MaxScale 2.1
2017-11-29 18:22:05 +01:00
MassimilianoPinto
8a10b72e4d Merge 2.1 in 2.2
Merge 2.1 in 2.2
2017-11-29 11:30:33 +01:00
Johan Wikman
a6e83f41f6 Add missing "%s" format 2017-11-28 14:31:57 +02:00
MassimilianoPinto
e16eee0cc3 MXS-1546: Don't check binlog read position when last event is HEARTBEAT_EVENT
Don't check binlog read position when last event is HEARTBEAT_EVENT
2017-11-28 13:24:35 +01:00
MassimilianoPinto
c44dd4a26c MXS-1530: stop replication unsupported binlog events
Stop replicating from master if unsupported binlog events are seen.

Also report error message for unsupported events
(blr_read_events_all_events) at maxscale start-up and with
maxbinlogcheck utility
2017-11-27 18:42:38 +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
520ee35bd2 MXS-1545: fix compile issue
MXS-1545: fix compile issue
2017-11-27 15:07:06 +01: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ä
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
MassimilianoPinto
927b4addc8 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-24 09:38:17 +01:00
Markus Mäkelä
396b81f336 Fix in-source builds
The internal header directory conflicted with in-source builds causing a
build failure. This is fixed by renaming the internal header directory to
something other than maxscale.

The renaming pointed out a few problems in a couple of source files that
appeared to include internal headers when the headers were in fact public
headers.

Fixed maxctrl in-source builds by making the copying of the sources
optional.
2017-11-22 18:40:18 +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