11784 Commits

Author SHA1 Message Date
Markus Mäkelä
c95adf1f2e
Add prefix to Server member variables
Added the m_ prefix to Server member variables.
2018-09-28 12:18:24 +03:00
Markus Mäkelä
3ee5d9a8ea
MXS-2067: Move server lock into Server class
The lock for the server is now only visible to the MaxScale core. Changing
the type to std::mutex also allows the use of RAII lock guards.
2018-09-28 12:18:23 +03:00
Markus Mäkelä
c0bc611f03
Remove unnecessary readconnroute code
The check for a closed session should never be needed as the core
correctly orders the calls to the module functions. The version numbering
was also not used.

Fixed the incrementation of the query counter so that it uses relaxed
atomic operations.
2018-09-28 12:18:23 +03:00
Markus Mäkelä
ab4f870927
MXS-2067: Replace most SPINLOCKs
Replaced SPINLOCK with std::mutex where possible, leaving out the more
complex cases. The big offenders remaining are the binlogrouter and the
gateway.cc OpenSSL locks.
2018-09-28 12:18:23 +03:00
Markus Mäkelä
50451166bb
MXS-2067: Remove spinlock.hh
Replaced the C++ versions with standard library mutexes.
2018-09-28 12:18:23 +03:00
Markus Mäkelä
fc1e36429c
MXS-2067: Replace SPINLOCK with pthread_mutex_t
Replaced the SPINLOCK implementation with pthread_mutex_t. The SPINLOCK
interface is still used and will be removed later on.
2018-09-28 12:18:23 +03:00
Esa Korhonen
fe81b399b2 Use maxbase time and clock classes instead of std::chrono 2018-09-27 17:04:59 +03:00
Esa Korhonen
05d18e81ae Use string instead of stringstream
Most of the monitor was already using string for formatted printing.
2018-09-27 16:46:59 +03:00
Johan Wikman
07e407945b Change ss_dassert -> mxb_assert
Caused by merge from 2.2.
2018-09-27 12:56:36 +03:00
Markus Mäkelä
66227301aa Merge branch '2.2' into develop 2018-09-27 11:47:32 +03:00
Johan Wikman
62ce6c15dc Add 2.2.15 release note and update change log 2018-09-27 10:35:43 +03:00
Johan Wikman
6e380d541b MXS-2043 Add system test 2018-09-27 10:17:47 +03:00
Johan Wikman
2aca6226d9 MXS-2043 Classify SELECT ... FOR UPDATE as QUERY_TYPE_WRITE
SELECT...FOR UPDATE locks the rows for update, but only if
autocommit==0 or a transaction is active, so in principle even if
it were classified as READ it'd still be sent to master when it
actually matters.

However, even if autocommit==1 and/or no transaction is active, a
slave in read only mode will reject the statement if the user is
subject to the read only restriction (a user with super privileges
is not), which might be considered a server bug. By classifying the
statement as a write, it'll be sent to master and always succeed.
2018-09-27 10:17:47 +03:00
Johan Wikman
743daa5755 MXS-2043 Create test that exposes problem
A statement like

    SELECT a FROM tbl FOR UPDATE;

should be classified like QUERY_TYPE_WRITE so as to be sent
to master.
2018-09-27 10:17:47 +03:00
Esa Korhonen
df3d08b959 Remove spammy debug print
The code was ran even when nothing was really going on and constantly wrote
to the log.
2018-09-26 14:03:08 +03:00
Esa Korhonen
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
Esa Korhonen
c58041d4fb Format MariaDBMonitor source
Some parts were manually edited for better results. No functional changes.
2018-09-26 12:49:14 +03:00
Esa Korhonen
bfb1c3f1b3 MXS-1944 Store switchover parameters in an object 2018-09-26 12:42:26 +03:00
Esa Korhonen
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
Niclas Antti
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
Niclas Antti
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
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ä
e73301ad71
Update NPM packages
Updated packages for MaxCtrl and the REST API tests.
2018-09-26 11:08:24 +03:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
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ä
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
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