11758 Commits

Author SHA1 Message Date
Markus Mäkelä
d0c5b2ff61
MXS-701: Amend binlogfilter documentation
Added clarifying comments and links to relevant documentation, fixed a
typo and changed some of the wording.
2018-09-26 11:26:37 +03:00
Markus Mäkelä
b1c734bb16
MXS-701: Add binlogfilter to Documentation-Contents.md 2018-09-26 11:26:36 +03:00
Niclas Antti
1063b4a6be Add missing cancel callback for delayed call.
And make the function a little neater.
2018-09-26 11:21:55 +03:00
Markus Mäkelä
ddd6feff69
Move transaction management into a subfunction
The readwritesplit transaction management was a large part of the
clientReply function. Moving it into a separate function clarifies the
clientReply function by hiding the comments and details of the transaction
management.
2018-09-26 09:43:26 +03:00
Markus Mäkelä
548d121699
MXS-2068: Use RWBackend in schemarouter
The schemarouter now uses the RWBackend to track the response states. This
fixes the debug assertions that happened with the mxs1113_schemarouter_ps
test.
2018-09-26 09:43:26 +03:00
Markus Mäkelä
24b438c9b6
MXS-2068: Split reply_is_complete into two functions
By splitting the processing and state querying into two separate
functions, the result can be inspected multiple times without triggering
the result processing.
2018-09-26 09:43:25 +03:00
Markus Mäkelä
60cb8127a0
MXS-2068: Remove unused code 2018-09-26 09:43:25 +03:00
Markus Mäkelä
a32361e894
MXS-2068: Move common functionality into RWBackend
The RWBackend now updates the internal state when a new write is done in
addition to acknowledging it when the reply is complete.
2018-09-26 09:43:25 +03:00
Markus Mäkelä
09a64753f1
MXS-2068: Move RWBackend into mysqlcommon
This cleanly allows multiple modules to use it.
2018-09-26 09:43:25 +03:00
Markus Mäkelä
50bec07438
Fix mxs1776_ps_exec_hang
The results weren't freed between the fetches.
2018-09-26 09:43:25 +03:00
Markus Mäkelä
4ed0ef046e
MXS-701: Update binlogfilter documentation
Rewrote most of the documentation.
2018-09-26 09:43:24 +03:00
Markus Mäkelä
a9155e9f0e
MXS-701: Use the default database with query events
If a query event uses an implicit database, the filtering is now correctly
done also for those tables.
2018-09-26 09:43:24 +03:00
Markus Mäkelä
82b3ffdf60
MXS-701: Clean up binlogfilter
Removed unused code, ordered function definitions that declarations aren't
needed, changed functions to pass pointers to the event body instead of
the start of the protocol packet.
2018-09-26 09:43:24 +03:00
Markus Mäkelä
5869f5369c
MXS-701: Extend binlogfilter test
The test now checks that default database usage works as expected. This
currently only works with RBR and with SBR it fails due to inadequate
processing of the SQL statements (default database is not concatenated
into the table).
2018-09-26 09:43:24 +03:00
Markus Mäkelä
d7fab9e43a
MXS-701: Make info messages more useful
The messages now tell whether an event was skipped.
2018-09-26 09:43:23 +03:00
Markus Mäkelä
da242973f5
MXS-701: Add binlogfilter test case
Added a simple test case that checks that the match and exclude parameters
work.
2018-09-26 09:43:23 +03:00
Markus Mäkelä
047242a721
MXS-701: Improve binlogfilter
Added `match` and `exclude` functionality. This allows versatile filtering
without a large investment of development time by leveraging the benefits
of PCRE2 regular expressions.

Also cleaned up the filter and removed the single table matching and
active parameter that were obsoleted by the regular expression parameters.
2018-09-26 09:43:01 +03:00
Markus Mäkelä
f3d96822d0
Merge branch '2.2' into develop 2018-09-25 22:30:55 +03:00
Markus Mäkelä
e5739c4e00
Merge branch '2.1' into 2.2 2018-09-25 22:29:41 +03:00
Niclas Antti
5132339b7b Fix race condition.
Change a counter (s_next_delayed_call_id) in Worker from class static to
class member to avoid race conditions on the variable.
2018-09-25 17:07:06 +03:00
Markus Mäkelä
6d9d046bcf
MXS-2051: Remove REST API from 2.1 2018-09-25 13:59:58 +03:00
Johan Wikman
25038432bb MXS-2047 Rename MARIADB_GTID_INFO::file -> binlog_name
That's how the concept is named elsewhere.
2018-09-25 10:08:30 +03:00
Johan Wikman
654d3f2bbe MXS-2047 Rename BLFILE::binlogname to BLFILE::binlog_name
That's how the concept is named everywhere else.
2018-09-25 10:07:11 +03:00
Johan Wikman
cc5e3eb0ac MXS-2047 Align variable names
MARIADB_GTID_ELEMS is called gtid_elms everywhere else.
2018-09-25 10:07:11 +03:00
Johan Wikman
77daf1fbdb MXS-2047 React on any fatal error 2018-09-25 10:07:11 +03:00
Johan Wikman
be4df2508f MXS-2047 Use same name for same concept
If a member variable in ROUTER_INSTANCE and ROUTER_SLAVE refer
to the same concept, the name used in both should be the same.
2018-09-25 10:07:11 +03:00
Johan Wikman
16e2740762 MXS-2047 Add column binlog_rdir to BLR gtid_maps table
This column will be used to store the relative path of the file
where a particular event can be found.

Unless the path is stored, BLR will not be able to find an event based
on the gtid if BRL is connected to a node in a Galera cluster and updates
are made to nodes other than that node as in that case, the GTID domain id
and server id, will not identify the correct directory.

The full path is not stored in the column binlog_file as the path
would in that case (without other modifications) be visible to the
client.
2018-09-25 10:07:11 +03:00
Johan Wikman
c105a71317 MXS-2047 Create test that reveals problem
If

* BLR replicates from a node in a Galera cluster and
* writes are made to all nodes in that cluster,

then

* if a slave to BLR is stopped when it has received an event
  originating in a node different than the one BLR is replicating
  from

the subsequent (re)starting of the slave will fail because BLR looks
for the last event from a file whose path contains the server id of
the node where the event originates, although it should look for it
in the file whose path contains the server id of the node from which
BLR replicates.
2018-09-25 10:07:11 +03:00
Johan Wikman
6e4556849c Deal with columns being NULL
As it is not possible to create an std::string from NULL, we
need to handle each value separately.
2018-09-25 10:07:11 +03:00
Markus Mäkelä
f17dfdbc2b
Fix filter destruction
The filter instances weren't cleared before the dynamically loaded
libraries were unloaded which caused a crash.
2018-09-24 12:08:04 +03:00
Markus Mäkelä
6d82de811f
Relax Average value access memory ordering
As there are no requirements with regards to the visibility of writes to
the Average, the access can be relaxed.
2018-09-24 12:07:50 +03:00
Markus Mäkelä
aa649a2754
Reduce failcount for mysqlmon_detect_standalone_master
The test seems to continue before the failover has finished. Reducing the
failcount from 2 to 1 should speed up the master failover process.
2018-09-24 12:07:50 +03:00
Markus Mäkelä
920fbb9d70
Fix mxs2037_namedserver_wildcards
The configuration used removed parameters.
2018-09-24 12:07:50 +03:00
Markus Mäkelä
ce43df5514
Refactor server_weight
Changed to stack allocated objects, removed unnecessary and corrected
false comments, removed obsolete log message checks.
2018-09-24 12:07:50 +03:00
Markus Mäkelä
f9e876db06
Fix Session destruction
The Session class was deleted via the opaque pointer instead of the actual
class pointer.
2018-09-24 12:07:49 +03:00
Markus Mäkelä
a94081067f
Move Average into average.hh
Moved the class to a more appropriate place.
2018-09-24 12:07:49 +03:00
Markus Mäkelä
5ed3667f4a
Document average.hh
Add documentation for the average classes.
2018-09-24 12:07:49 +03:00
Esa Korhonen
02d5840d5b MXS-1762 Add reset-replication test
The test adds events to the backends, causing them to go out of sync. It then
uses the reset-replication command to fix the situation and checks replication
is working.
2018-09-24 10:56:33 +03:00
Esa Korhonen
dfc10b109d MXS-1937 Add failover/switchover with server events test
The test adds a scheduled server event, the does failover, rejoin and
switchover and checks that event is manipulated correctly. Also includes
a change to the monitor to fix an invalid ALTER EVENT query when the event
definer has wildcard host.
2018-09-24 10:43:17 +03:00
Markus Mäkelä
e5a0b4e9bb
Merge branch '2.2' into develop 2018-09-21 14:18:15 +03:00
Markus Mäkelä
d55c07dc2e
MXS-2066: Reset resultset collection by default
The collection of resultsets needs to be disabled by default when a
response is received to cover the cases where an error is returned.

The collection of results should also not be set for queries that do not
generate any responses.
2018-09-21 11:14:45 +03:00
Markus Mäkelä
60915f847f
MXS-2064: Log workaround for grant problems with MariaDB 10.2.10
When the 10.2 users query is executed with a MariaDB server older than
10.2.11, the query will fail due to inadequate grants on the 'users' table
generated as a part of the CTE. To work around the issue, a SELECT grant
on the whole mysql database is required. Logging the server where the
query fails also helps resolve the problem by pointing out where the grant
needs to be added.
2018-09-21 11:14:45 +03:00
Markus Mäkelä
e888bcac3b
MXS-2045: Update avrorouter tutorial
Removed unnecessary sections and updated some of the text to be more
specific. Expanded the explanations on where the replication starts and
how the avrorouter needs to be configured. Added example output from the
cdc.py client and removed the relatively useless maxavrocheck section.
2018-09-21 11:14:45 +03:00
Esa Korhonen
2ab748dbab MXS-1712 Update MariaDB Monitor documentation
Add documentation on reset-replication. Adds some details on cluster modification
operations in general and fixes errors.
2018-09-21 10:54:36 +03:00
Esa Korhonen
a3adcea524 MXS-1712 Cleanup reset-replication
Now logs messages explaining what has been done. Scheduled events are
disabled/enabled during the operation. Redirection of slaves is done at
the end similar to failover/switchover.
2018-09-21 10:54:36 +03:00
Markus Mäkelä
71ffef5708
Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
Markus Mäkelä
1689fe7f48
Update user documentation
The documentation mentions a bug in MariaDB 10.2.9 that causes problems
with the new users query.
2018-09-20 13:04:54 +03:00
Markus Mäkelä
d8d0b1a29c
Merge branch '2.2' into develop 2018-09-20 12:21:53 +03:00
Markus Mäkelä
8c2f6aafcc
MXS-2060: Load users from only valid servers
Users should only be loaded from a server if it is running and not in
maintenance.
2018-09-19 20:32:39 +03:00
Markus Mäkelä
40c4614ed1
Update mocha
Updated mocha to latest version for maxctrl and REST API test suites.
2018-09-19 20:32:39 +03:00