Commit Graph

12169 Commits

Author SHA1 Message Date
dd9ff27743 MXS-1845 Rewrite server promotion code
In progress, does not yet overwrite existing code.

The new promotion mechanism automatically retries queries which timed out. It also
handles multimaster situations correctly.
2018-09-26 13:20:29 +03:00
c58041d4fb Format MariaDBMonitor source
Some parts were manually edited for better results. No functional changes.
2018-09-26 12:49:14 +03:00
bfb1c3f1b3 MXS-1944 Store switchover parameters in an object 2018-09-26 12:42:26 +03:00
c20a17238b MXS-1944 Store failover parameters in an object
Several of the parameters are passed on from function to function. Having them all
in an object cleans things up and makes adding more data easier.
2018-09-26 12:26:35 +03:00
92832c1ec4 MXS-1777 Remove selection of servers with historically lower number of connections.
Removed the almost equal comparison and subsequent selection based on historical number of connections.
The effect of it was this: Select the server that has historically, weights or not, been slower. Tested this with 2.2
with maxscale on one server and mariadb:s on two servers with different network lags. The tests with historical
selects were clearly slower.
2018-09-26 12:05:48 +03:00
7d231e5328 MXS-1777 Changing server weights to match 2.2 behavior.
Match 2.2, changed the weights back to non-inverse because 0-weight
is a special case. Renamed to server_weight for greppability.
2018-09-26 12:05:48 +03:00
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
b1c734bb16 MXS-701: Add binlogfilter to Documentation-Contents.md 2018-09-26 11:26:36 +03:00
1063b4a6be Add missing cancel callback for delayed call.
And make the function a little neater.
2018-09-26 11:21:55 +03:00
e73301ad71 Update NPM packages
Updated packages for MaxCtrl and the REST API tests.
2018-09-26 11:08:24 +03:00
32fbd59f85 Add ASAN options into systemd service files
By default ASAN only reports the errors and doesn't cause the program to
crash. By forcing a SIGABRT, the process will generate a core dump which
causes the test to fail.

Although the act of placing environment variables inside the systemd
service file might seem intrusive, they have no effect on non-ASAN
builds. This appears to be the most convenient and straightforward way of
changing ASAN behavior for testing.
2018-09-26 11:08:23 +03:00
7d2a5b2c13 Fix readwritesplit debug assertion
The debug assertion is wrong as the code was changed to prioritize hints
over the router target selection. Also removed the superficial check for
master, slave and relay master states as they are implied by the fact that
the connection is in use.
2018-09-26 11:08:23 +03:00
1a41f1a8e2 Add more timeouts to mxs1743_rconn_bitmask
The test timed out on a few test runs which means that there is a problem
in the areas where timeouts weren't present.
2018-09-26 11:08:12 +03:00
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
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
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
60cb8127a0 MXS-2068: Remove unused code 2018-09-26 09:43:25 +03:00
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
09a64753f1 MXS-2068: Move RWBackend into mysqlcommon
This cleanly allows multiple modules to use it.
2018-09-26 09:43:25 +03:00
50bec07438 Fix mxs1776_ps_exec_hang
The results weren't freed between the fetches.
2018-09-26 09:43:25 +03:00
4ed0ef046e MXS-701: Update binlogfilter documentation
Rewrote most of the documentation.
2018-09-26 09:43:24 +03:00
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
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
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
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
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
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
e54a44d56a Extend MDEV-13453 workaround explanations
The example SQL now shows the extra grant required for 10.2 versions. Also
removed duplicate user creation examples from the tutorials.
2018-09-26 09:39:59 +03:00
f3d96822d0 Merge branch '2.2' into develop 2018-09-25 22:30:55 +03:00
e5739c4e00 Merge branch '2.1' into 2.2 2018-09-25 22:29:41 +03:00
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
6d9d046bcf MXS-2051: Remove REST API from 2.1 2018-09-25 13:59:58 +03:00
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
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
cc5e3eb0ac MXS-2047 Align variable names
MARIADB_GTID_ELEMS is called gtid_elms everywhere else.
2018-09-25 10:07:11 +03:00
77daf1fbdb MXS-2047 React on any fatal error 2018-09-25 10:07:11 +03:00
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
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
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
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
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
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
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
920fbb9d70 Fix mxs2037_namedserver_wildcards
The configuration used removed parameters.
2018-09-24 12:07:50 +03:00
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
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
a94081067f Move Average into average.hh
Moved the class to a more appropriate place.
2018-09-24 12:07:49 +03:00
5ed3667f4a Document average.hh
Add documentation for the average classes.
2018-09-24 12:07:49 +03:00
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
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