11820 Commits

Author SHA1 Message Date
Markus Mäkelä
d866cb3a21
Add bias value to server score calculations
By biasing the values of all counter type scores to positive integers, the
server weights are always taken into use.

This fixes the case when weights were ignored until all score base values
were larger than zero (the mxs922_server test).
2018-10-03 08:41:44 +03:00
Markus Mäkelä
ea971a664e
Fix readconnroute debug assertion
If the DCB is closed in handleError, it would be NULL in closeSession. To
only close the DCB in one place, the handleError can be reduced to writing
an error to the client and marking the failure as a fatal one.
2018-10-03 08:41:44 +03:00
Markus Mäkelä
4216ffa384
Use std:🧵:hardware_concurrency
Using a standard-defined value is better than a system specific one.
2018-10-03 08:41:43 +03:00
Markus Mäkelä
e10f34d6aa
Remove size restrictions from network reads
The reads now read as much of the data as is available to reduce the
number of distinct malloc calls that need to be made. The SSL_read also
now allocates the buffer before reading into it so that the amount of
copying is reduced.

Also removed some of the not quite helpful debug messages.
2018-10-03 08:41:43 +03:00
Markus Mäkelä
1ed708559d
Assert that buffers are thread-local
Cross-thread usage of buffers should not happen and the debug assertions
help verify it.
2018-10-03 08:41:43 +03:00
Markus Mäkelä
304286e5fa
Remove unused code
The BUFFER_TRACE code was not in use and did not work as the HASHTABLE was
removed.
2018-10-03 08:41:42 +03:00
Esa Korhonen
d14b9bfe43 MXS-1845 Cluster stabilization rewrite
No longer writes events to the master, as this creates problems if the
promoted server was not the overall master. Instead, the slave status
output is inspected.
2018-10-02 11:09:16 +03:00
Esa Korhonen
1ca5d02abb MXS-1845 Add redirection code
Should work with multimaster replication.
2018-10-02 11:09:16 +03:00
Markus Mäkelä
75f9921ca2
Merge branch '2.2' into develop 2018-10-02 10:18:09 +03:00
Markus Mäkelä
dad4f55ee6
Save output of mysqlmon tests
Before the tests truncate the log, it can be copied to a backup file. This
allows the whole log to be inspected after the test is complete.
2018-10-02 09:44:02 +03:00
Markus Mäkelä
288fbc8c33
MXS-2075: Only enable stdout redirection for maxscale
The stdout redirection must not be enabled for the other programs as they
are not run as daemon processes.
2018-10-02 09:44:02 +03:00
Markus Mäkelä
048aee1fb7
Print output of failed Travis tests
If a unit test fails, print the output.
2018-10-02 09:44:02 +03:00
Markus Mäkelä
79d1eb19d7
Disable unit test leak checks for DEB packages
The unit tests themselves don't leak memory but some of the core
components of MaxScale do. To ignore this, ASAN_OPTIONS needs to be
defined.
2018-10-02 09:44:02 +03:00
Markus Mäkelä
62e5f988c5
MXS-2075: Redirect stdout and stderr to the log
If the log file is successfully opened, both stdout and stderr are
redirected to it. This helps catch ASAN reports without having to read the
system journal files.

As the output is redirected to a file, some of the output was made visible
only in non-daemon mode. This helps keep the log file clean and readable.
2018-10-02 09:44:02 +03:00
Markus Mäkelä
3fd0c2c407
Stop timeout during slave sync 2018-10-02 09:44:01 +03:00
Markus Mäkelä
7b5985d6be
Add missing connect to mxs682_cyrillic
The connections were used without connecting.
2018-10-02 09:44:01 +03:00
Markus Mäkelä
c7fc00b3d8
Shorten mxs812_1
Three iterations should be adequate for most cases.
2018-10-02 09:44:01 +03:00
Markus Mäkelä
d87d462c76
MXS-2049: Update GSSAPI documentation
Corrected the documentation and provided more details on how to configure
the authenticator.
2018-10-02 09:44:01 +03:00
Markus Mäkelä
f65c890287
MXS-2049: Forward client credentials to backend server
Instead of requesting another set of credentials, the client credentials
are simply forwarded to the backend MariaDB server.
2018-10-02 09:44:01 +03:00
Markus Mäkelä
93d866c6a7
MXS-2073: Add missing TCP_NODELAY for client sockets
The client connections had the Nagle algorithm enabled which could cause
bad performance with smaller workloads. The common network configuration
code in utils.cc, currently used by the backend connections, sets it
properly.
2018-10-02 09:44:00 +03:00
Markus Mäkelä
ee45900648
Remove network variable export file after use
Otherwise the file is left in the current working directory.
2018-10-02 09:44:00 +03:00
Esa Korhonen
6b8443aba6 MXS-1845 Complete server promotion code
Now copies slave connections from the previous master. Promotion
code taken into use.
2018-10-01 18:06:39 +03:00
Johan Wikman
809ab487b2 Update version number for 2.2 2018-10-01 13:13:40 +03:00
Johan Wikman
dbbadf1f53 Merge branch '2.2' into develop 2018-10-01 13:10:41 +03:00
Johan Wikman
c58a461f87 Merge branch '2.2.15' into 2.2 2018-10-01 13:10:05 +03:00
Johan Wikman
03137428fa Update 2.2.15 release date
And add missing link in change log.
2018-10-01 13:01:56 +03:00
Niclas Antti
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
Markus Mäkelä
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
Markus Mäkelä
bb8245d2c1
Merge branch '2.2' into develop 2018-09-30 21:26:47 +03:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
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
Markus Mäkelä
104a6d1bfb
Explicitly link against ASAN libraries
Some systems (Ubuntu Trusty) require explicit linking against ASAN
libraries.
2018-09-28 11:05:51 +03:00
Markus Mäkelä
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
Markus Mäkelä
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
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