Commit Graph

9268 Commits

Author SHA1 Message Date
925fff4abc MXS-1518: Fix ssl_cert_verify_depth documentation
Corrected the parameter name to the actual used value.
2017-11-14 16:51:34 +02:00
9d686c4c41 MXS-1461 Create error message only when blocking
Only if the filter is in blocking mode, will a match cause an error
to be returned. Thus, no point in creating the error message unless
the filter is in blocking mode.
2017-11-14 13:03:07 +02:00
ea0f8978b2 MXS-1461 Update log messages of firewall rules
Whether or not a match causes the query to be blocked or to be allowed
depends on whether the filter is in white-listing or black-listing mode,
so better if the text is neutral.
2017-11-14 13:03:07 +02:00
3eba77f43e MXS-1461 Implement not_function
If the instance represents `not_function` then it is a match if the
used function is not found amongst the listed functions.
2017-11-14 13:03:07 +02:00
3993ece209 MXS-1461 Remove special handling for function + allow
No need for this when 'not_function' is available.
2017-11-14 13:03:07 +02:00
3215458b30 MXS-1461 Introduce 'not_function' rule
Using 'not_function' it is possible to match functions other than
a specific set of ones. That will make it significantly easier to
allow certain functions to be used with certain columns.

The special handling of no arguments to `function` in conjunction
with an allowing filter has been removed. The same effect can now
be achieved, without special handling, using `not_function`, no
arguments and a blocking filter.

Implementation will follow in a subsequent commit.
2017-11-14 13:03:07 +02:00
ced93acc20 MXS-1514: Add failover test
The test is composed of a few parts.
1: Test that failover happens on master failure.
2: Test that a server with slave sql thread stopped is not promoted.
3: Test that a server with log_slave_updates=1 is promoted before others.
2017-11-14 10:01:37 +02:00
41f6400852 MXS-1476: Add test case
Test for MXS-1476 that checks that the behavior is what is
expected. Currently, the test passes as behavior is what is expected.
2017-11-13 11:55:54 +02:00
b2b72474d9 Initialize thread as well in test_trxtracking 2017-11-10 14:45:54 +02:00
6cc8bc36c1 Initialize in test_dcb
Make necessary initializations in test_dcb.
2017-11-10 14:45:54 +02:00
f2b9525032 Initialize thread as well in test_trxcompare 2017-11-10 14:45:54 +02:00
f152c118cb Name core tests consistently
Now, given a concept xyz,
* the main test file is called test_xyz.cc
* the executable is called test_xyz, and
* the ctest test is called text_xyz.
2017-11-10 14:45:54 +02:00
bc36dd3e1a Update 2.1 version to 2.1.11 2017-11-10 09:57:33 +02:00
2792f54089 Use explicit script path in test_maxctrl
The path to the script is now explicitly defined. This makes the call
unambiguous as the home directory depends on the current user.
2017-11-10 09:37:51 +02:00
5acdfab5e6 Start MaxScale as maxscale user in run_ctrl_c.sh
MaxScale should not be started as root.
2017-11-09 14:15:47 +02:00
dd58a8b3c8 Add missing close definition for examplefilter
The filter session method was not defined.
2017-11-09 14:15:47 +02:00
e68f16b099 Merge branch '2.2' into 2.2-mrm 2017-11-09 09:41:58 +02:00
3dbd201a86 MXS-1478 Provide daemon flag
With "--daemon" or "-n" MaxScale can now be told to run in daemon
mode, that is, it forks and the parent exits. This is the default
behaviour, but a flag to this effect is needed if the default
behaviour is changed.
2017-11-09 09:34:23 +02:00
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
0558a2195d MXS-1479 By default, refuse to run as root
MaxScale now refuses to run as root. However, it is possible to
start MaxScale as root, as long as a user to run MaxScale as is
provided as a command line argument.

It is possible to run as root by invoking MaxScale as root and
by specifying the MaxScale user to be root.
2017-11-08 16:03:05 +02:00
17b7cde56a Clarify query_retries documentation
The parameter documentation did not clearly specify that it affects only
internal queries done by the core and monitors.
2017-11-08 11:54:55 +02:00
3a13469691 MXS-1490 Fix bug with gtid_io_pos change check
The conditional was opposite to intention.
2017-11-08 10:46:51 +02:00
a1a5947d61 MXS-1490: Parse Gtid_IO_Pos only when using Gtid
First check "Using_Gtid", as that should be always valid. If set to
"Slave_Pos", parse "Gtid_IO_Pos".
2017-11-08 10:46:51 +02:00
3a35d49ffe Merge branch '2.2' into 2.2-mrm 2017-11-08 10:44:35 +02:00
42d9064b04 Remoeve queuemanager.[h|cc] 2017-11-08 10:44:14 +02:00
b1b78a5be7 Remove references to QUEUE_CONFIG
Only used in conjunction with queued connections, which are not
enabled anyway. Once that comes on the table again, better to use
some standard data structures.
2017-11-08 10:44:14 +02:00
4da28789ac Fix SSL regression
This builds on commit 1287b0e595a5f99026f66df7eeaef091b8ffc774 and cleans
up the original code. This fixes a bug introduced in the aforementioned
commit and cleans up the code.
2017-11-08 10:13:19 +02:00
4cf01fa88f Remove 'failover_script' parameter
As the failover is now internal to MySQL Monitor, no failover
script parameter is needed.
2017-11-07 16:05:44 +02:00
dce073a684 MXS-1496: Don't assign slave status for masters
The slave and stale slave status bits should be cleared from a master if
it still has them.

Also used the correct functions to manipulate the bits instead of directly
setting them in the monitor.
2017-11-07 15:52:28 +02:00
84e95cee96 MXS-1490: Query gtid_slave_pos only during failover
The value of the global gtid_slave_pos is only needed during
failover, so querying it every monitor loop is unnecessary. The
value is now only requested when deciding on a new master server
or when waiting for the selected promotion target to clear its
relay logs.

Also, when waiting for the logs to clear, gtid_io_pos must stay
constant or failover is cancelled. Io_pos advancing indicates that
the server is still receiving events from the old master.
2017-11-07 13:09:51 +02:00
f44020496a Merge branch '2.2' into 2.2-mrm 2017-11-07 12:05:33 +02:00
d7b8e95234 MXS-1489 Create mechanism for running concurrent tasks
This commit introduces maxscale::future, maxscale::packaged_task
and maxscale::thread that are modeled after C++11 std::future,
std::packaged_task and std::thread as described here:
http://en.cppreference.com/w/cpp/thread

The standard classes rely upon rvalue references (and move
constructors) introduced by C++11. As the C++ compilers we must use
are pre-C++11 that feature is obviously not present. The absence of
rvalue references is circumvented by implementing regular copy
constructors and assignment operators as if the arguments were rvalue
references.

In practice the above means that when one of these objects are copied,
the state is _moved_ rendering the copied object in default initialized
state. Some care is needed to ensure that unintended copying does not
occur.
2017-11-07 12:03:09 +02:00
a96c8e1326 Install explicit version of pkg
The installed version of `pkg` was not locked a specific release.
2017-11-07 12:03:09 +02:00
5db02586b1 Use the external CDC connector
The CDC connector was moved to its own repository and some changes to its
interface were made. Updated build scripts, deleted old connector and
fixed code to use new interfaces.
2017-11-07 12:03:09 +02:00
ce19fe3248 Move Jansson compilation into main test suite
The test suite now compiles Jansson instead of letting the CDC connector
do it. This way the connector can be used as a very simple static library
with a dependency on the Jansson library.
2017-11-07 12:03:09 +02:00
96d9ec1b6d Update the CDC connector
The CDC connector now uses a non-blocking socket for the reads. This
allows the possibility of adding read timeouts.

Added some utility functions for dealing with GTIDs and delayed the
reading of the first row.
2017-11-07 12:03:09 +02:00
e7342324d7 Update binlogrouter documentation and release notes
Removed references to removed parameters, and updated release notes.
2017-11-07 10:57:40 +02:00
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
4f01ff1955 Add C++ filter example
The filter example uses the C++ template which helps new filter creation
by showing the minimal implementation required for a filter.
2017-11-07 08:38:51 +02:00
0bb54511b7 MXS-1490: Query binlog & gtid settings, read @@gtid_slave_pos
The Gtid_Slave_Pos returned by SHOW ALL SLAVES STATUS is not quite
reliable (MDEV-14182) so the variable version is used instead. Added
a convenience function for querying a single row of values.

Also,  gtid_strict_mode, log_bin and log_slave_updates are now
queried during failover. The first only causes a warning message
if disabled, the last two affect new master selection.
2017-11-06 12:23:35 +02:00
0131841787 Fix dbfwfilter and cachetester dependencies
The two depended on the PCRE2 and Connector-C libraries which means that
the libraries need to be built first. This information needs to be told to
CMake with the add_dependency call.
2017-11-05 19:24:56 +02:00
43cea6a2fa Reorder linking of libraries
The cdc-connector did not build on Ubuntu Trusty due to the wrong order of
linker flags. Moving the crypt and crypto linkage to be after
cdc-connector appears to fix it.
2017-11-05 11:16:26 +02:00
f12579578b Install explicit version of pkg
The installed version of `pkg` was not locked a specific release.
2017-11-03 13:45:31 +02:00
a294da407a Use the external CDC connector
The CDC connector was moved to its own repository and some changes to its
interface were made. Updated build scripts, deleted old connector and
fixed code to use new interfaces.
2017-11-03 13:39:36 +02:00
f815e9caa5 Move Jansson compilation into main test suite
The test suite now compiles Jansson instead of letting the CDC connector
do it. This way the connector can be used as a very simple static library
with a dependency on the Jansson library.
2017-11-03 13:39:36 +02:00
96e86cddad Update the CDC connector
The CDC connector now uses a non-blocking socket for the reads. This
allows the possibility of adding read timeouts.

Added some utility functions for dealing with GTIDs and delayed the
reading of the first row.
2017-11-03 13:39:36 +02:00
1287b0e595 Backport authentication fix from 2.2
The authentication code assumed that the initial request only had
authentication related data. This is not true if the client library
predicts that the authentication will succeed and it sends a query right
after it sends the authentication data.
2017-11-03 11:00:54 +02:00
8cac26a14d Merge branch '2.2' into 2.2-mrm 2017-11-02 12:46:00 +02:00
6fc8e9cb21 Add .gitignore to maxscale-system-test 2017-11-02 11:51:32 +02:00
2115ad7911 Make lines <= 110 chars long 2017-11-02 09:29:24 +02:00