Commit Graph

11797 Commits

Author SHA1 Message Date
dbbadf1f53 Merge branch '2.2' into develop 2018-10-01 13:10:41 +03:00
c58a461f87 Merge branch '2.2.15' into 2.2 2018-10-01 13:10:05 +03:00
03137428fa Update 2.2.15 release date
And add missing link in change log.
2018-10-01 13:01:56 +03:00
c65edd1298 Enhance StopWatch
Clean up, comments and enhancements. StopWatch lap() didn't mean lap-time, but elapsed time. Changed meaning to lap-time and added split() for split-time.
2018-10-01 09:30:24 +03:00
ceb763c9be Fix buffer size in cache rules
If a database, table and a column was defined, the null terminating
character would be written past the end of the buffer.
2018-09-30 22:35:13 +03:00
bb8245d2c1 Merge branch '2.2' into develop 2018-09-30 21:26:47 +03:00
4554bd1743 Cherry-pick: Fix ASAN problems
Cherry-picking the commit from develop since it's also needed for 2.2.

FindASAN did not look for so version 5 and TSAN referred to ASAN. Disable
leak checks for unit tests as some objects always leak, namely servers.
2018-09-30 20:12:35 +03:00
77b53b0889 MXS-2067: Fix build failures
The luafilter didn't include the <mutex> header and mqfilter used the
wrong lock type.
2018-09-30 19:37:12 +03:00
0387736130 Fix ASAN problems
FindASAN did not look for so version 5 and TSAN referred to ASAN. Disable
leak checks for unit tests as some objects always leak, namely servers.
2018-09-30 19:37:12 +03:00
9278da1f54 MXS-2067: Remove spinlock.h
Removed the spinlock.h header and replaced with plain pthread types and
functions.
2018-09-28 12:18:24 +03:00
c95adf1f2e Add prefix to Server member variables
Added the m_ prefix to Server member variables.
2018-09-28 12:18:24 +03:00
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
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
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
50451166bb MXS-2067: Remove spinlock.hh
Replaced the C++ versions with standard library mutexes.
2018-09-28 12:18:23 +03:00
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
104a6d1bfb Explicitly link against ASAN libraries
Some systems (Ubuntu Trusty) require explicit linking against ASAN
libraries.
2018-09-28 11:05:51 +03:00
5b644a785b Refactor mxs682_cyrillic
Use stack allocated objects and do general cleanup. Increased timeouts to
be a bit more forgiving.
2018-09-28 09:24:48 +03:00
afd3eae65b Add more output to mxs1743_rconn_bitmask
The test times out but it doesn't tell where it times out.
2018-09-28 09:15:02 +03:00
fe81b399b2 Use maxbase time and clock classes instead of std::chrono 2018-09-27 17:04:59 +03:00
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
07e407945b Change ss_dassert -> mxb_assert
Caused by merge from 2.2.
2018-09-27 12:56:36 +03:00
66227301aa Merge branch '2.2' into develop 2018-09-27 11:47:32 +03:00
62ce6c15dc Add 2.2.15 release note and update change log 2018-09-27 10:35:43 +03:00
6e380d541b MXS-2043 Add system test 2018-09-27 10:17:47 +03:00
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
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
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
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