10772 Commits

Author SHA1 Message Date
Markus Mäkelä
2005164222
Fix slave reconnection logic
Allowing calls to select_connect_backend_servers even when all slaves are
connected solves the debug assertion in select_connect_backend_servers
that happens when the execution of a queued query causes a new connection
to be created.
2018-06-15 16:16:53 +03:00
Markus Mäkelä
3ed6411741
Fix debug assert on reconnection with session commands
When a query was routed to a server that must first be connected to, the
expected response count was not updated for the executed session commands.
2018-06-15 16:16:53 +03:00
Markus Mäkelä
9dd8043359
Add network throttling documentation
Added documentation for MXS-1690.
2018-06-15 16:16:53 +03:00
Markus Mäkelä
d2e7be2ca0
Acknowledge one-way commands immediately
The Backend class response state tracking was not updated when a one-way
command was executed. This caused the logic in handleError to break if a
master was executing a command that wouldn't create a response.
2018-06-15 16:16:53 +03:00
Markus Mäkelä
1ea94501e4
Prefer servers that are not busy executing session commands
Readwritesplit now prefers servers that are not busy executing session
commands. This should give the best responsiveness for reads.
2018-06-15 16:16:53 +03:00
Markus Mäkelä
70104f957e
Fix readwritesplit hang when query is queued
Readwritesplit would hang when the query execution is postponed due to the
fact that the target server is executing a session command. The number of
expected responses was incremented when no response was expected.
2018-06-15 16:16:53 +03:00
Markus Mäkelä
17535acfc3
Fix test failures
Replaced sleep in bug676 with wait_for_monitor, removed unsupported
commands from maxinfo_sql.
2018-06-15 16:16:52 +03:00
Markus Mäkelä
61cc709519
Prevent hangs in mxs173_throttle_filter
The test now sets a two minute timeout for all larger operations. This
prevents excessive waiting when the test is executed.

Removed the row count output to stdout to prevent excessive logging when
the terminal contents are written to a file.

Also renamed the file to match the test case name. This should remove the
need to find the source file to test name mapping from the CMakeLists.txt.
2018-06-15 16:16:52 +03:00
Markus Mäkelä
1c9e03ec9c
Merge commit '18f51eba795f70c35faa2c6767bfda72213e8aae' into develop 2018-06-15 14:40:22 +03:00
Johan Wikman
bed1c60fd4 MXS-421 Allow specifying a facility when logging
In principle a syslog priority consists of a syslog level
bit-or:d with a syslog facility. That's clear from the syslog
man page, but not so clear from the code in syslog.h.

Anyway, to make it possible to log using a specific facility
(instead of the default LOG_USER), we must allow priorities
that include a specified facility.
2018-06-15 12:41:52 +03:00
Johan Wikman
c465511482 MXS-421 Add documentation 2018-06-15 12:41:52 +03:00
Niclas Antti
a6c53b545d Remove incorrect version of MXS1777 - had old paths and namespaces. 2018-06-15 12:34:38 +03:00
Niclas Antti
2514c99d9e MXS-1777 Create new utility library
The purpose of this library is to create a utility library that is not
dependent on maxscale for use in both maxscale and system test, and
possibly other apps. As time permits general purpose utilities from
maxscale-common can be moved to the new library.

Here are answers to questions you may have:
- A top level directory "maxutils" contains the libraries. The current
  structure is simply maxutils/maxbase. Each library has an 'include' and
  a 'scr' directory where public headers exist in 'include'
- Code is in a namespace with the same name as the directory.
- Headers are included like this: `#include <maxbase/stopwatch.hh>`
- In case the library is published on its own, the include directives stay
  the same (headers would be in /usr/include/maxutil, for example).
- I am not advocating many small libraries. But if some larger library
  is written, say a general purpose statemachine, it would not pollute
  util/maxutil but go to util/maxsm.
  Another example: Worker. It is a larger concept, but used so widely in
  code that it could very well live in maxutil.

NOTE: this was previously Review Request #6245.
2018-06-15 12:05:57 +03:00
Markus Mäkelä
18f51eba79
Disable SQLite journal
The SQLite journal is not needed since the databases are created in-memory
and are thread-specific.
2018-06-15 11:16:27 +03:00
Markus Mäkelä
a812e02ba4
Merge branch '2.2' into develop 2018-06-15 10:48:07 +03:00
Markus Mäkelä
37139dfe69
Merge branch '2.1' into 2.2 2018-06-15 10:24:38 +03:00
Markus Mäkelä
4cc4deeaf1
MXS-1843: Test log throtting in a unique directory
This rules out external influence as a reason for the test failure.
2018-06-15 10:07:49 +03:00
Markus Mäkelä
856d513040
MXS-1924: Enable WAL mode for sqlite
The mysqlauth SQLite database is now opened in WAL mode if possible. This
should prevent lockups of the database when the list of users is updated.

Also moved the starting of the SQLite transaction one level up to also
include the delete part in it. This should further reduce the effects of
updating users.
2018-06-15 10:01:28 +03:00
Johan Wikman
34c33ce798 Remove unnecessary includes of hashtable.h 2018-06-15 09:55:44 +03:00
Niclas Antti
68c0c59d92 The purpose of this library is to create a utility library that is not
dependent on maxscale for use in both maxscale and system test, and
possibly other apps. As time permits general purpose utilities from
maxscale-common can be moved to the new library.

Here are answers to questions you may have:
- Headers and sources are separated to allow public/private headers.
- A top level directory "util" contains the libraries. The current
  structure is simply util/maxbase. The name of the top level
  directory is not important.
- Code is in a namespace with the same name as the directory.
- Headers are included like this: \`#include <maxbase/stopwatch.hh>\`
- In case the library is published on its own, the include directives stay
  the same (headers would be in /usr/include/maxbase, for example).
- I am not advocating many small libraries. But if some larger library
  is written, say a general purpose statemachine, it would not pollute
  util/maxutil but go to util/maxsm.
  Another example: Worker. It is a larger concept, but used so widely in
  code that it could very well live in maxutil.

NOTE: this was previously Review Request #6245.
2018-06-14 16:10:22 +03:00
Markus Mäkelä
3d1c2b421a
MXS-1921: Explain why session was closed
When a client connection is closed by MaxScale before the client initiates
a controlled closing of the connection, an error message is sent. This
error message now also explains why the connection was closed to make
problem resolution easier.
2018-06-14 13:48:07 +03:00
Esa Korhonen
de37f1a5c4 Fix cycle find test 2018-06-14 10:28:10 +03:00
Markus Mäkelä
bbeaaa97b5
Merge branch '2.2' into develop 2018-06-13 23:18:52 +03:00
Markus Mäkelä
315738f279
Merge branch '2.1' into 2.2 2018-06-13 23:15:11 +03:00
Markus Mäkelä
53177c30de
Fix runtime listener creation
The number of arguments to createListener was incremented but the maximum
count was not. Also fixed the parameter types for createListener and
alterServer.
2018-06-13 23:13:16 +03:00
Markus Mäkelä
143882ddce
Merge branch '2.1' into 2.2 2018-06-13 21:04:49 +03:00
Marko
f6e01b4434 MXS-591 Fix documentation and change comment parameter type 2018-06-13 20:44:32 +03:00
Esa Korhonen
5324a1bdaa MXS-1845 Assign server roles
Assign server roles (master, slave, relay master, slave of external master)
for a graph with possibly multiple paths to a slave server.
2018-06-13 17:38:53 +03:00
Esa Korhonen
3f82c25c62 MXS-1845 New algorithm for finding the master server
Not yet used, as more is needed to replace the old code. The
algorithm is based on counting the total number of slave nodes
a server has, possibly in multiple layers and/or cycles.
2018-06-13 17:38:33 +03:00
Markus Mäkelä
1ea7c65861
Fix runtime alteration of servers
The server runtime alteration was broken by commit
c850336199c3c19508a3d280fb7000291d66b80c when it increased the maximum
argument count of the `alter server` command to 14.
2018-06-13 14:29:28 +03:00
Markus Mäkelä
1475b22eac
Upgrade REST-API npm packages
Upgraded packages to more recent versions.
2018-06-13 10:07:37 +03:00
Markus Mäkelä
8094c67ac2
Merge branch '2.2' into develop 2018-06-13 00:25:56 +03:00
Markus Mäkelä
e99d9826ad
Fix route_by_statement return value
The return value of route_by_statement was not initialized and not set if
a COM_CHANGE_USER was processed.
2018-06-12 23:55:30 +03:00
Markus Mäkelä
24870e278c
MXS-1913: Check session before invoking dcb_foreach callback
If the session is the dummy session, the callback should not be called.
2018-06-12 23:55:30 +03:00
Markus Mäkelä
780620e796
Only use __atomic builtins
Now that the compiler for CentOS 6 was upgraded, there is no need to
support the old __sync builtins.
2018-06-12 19:40:34 +03:00
Markus Mäkelä
6927e67a6d
Enable rhscl repo for RHEL 6
To use the devtoolset, we need to enable the rhscl repo if we are running
RHEL 6. This fix most likely only works for the RHEL 6 images on AWS.
2018-06-12 19:40:34 +03:00
Markus Mäkelä
0627e8dc86
Resolve all symbols for routers at link time
The routers should not have undefied references. Exceptions to this are
the modules that use the maxscale_shutdown() function defined in
gateway.cc.
2018-06-12 19:40:34 +03:00
Markus Mäkelä
1946cb2876
Take a lambda function into use in readwritesplit
To test whether the compiler conforms to C++11, we can try to use a lambda
function.
2018-06-12 19:40:34 +03:00
Markus Mäkelä
a367267756
Enable newer compiler for CentOS 6
Install devtoolset-4 on CentOS 6 to enable C++11 on all supported
platforms. Change compiler flags to `-std=c++11` to explicitly use C++11.
2018-06-12 19:40:34 +03:00
Johan Wikman
d9100278b0 MXS-1719 Update qc test parser
The recent change to the qc_sqlite parser also requires some
modifications to the parser used for reading .test-files.
2018-06-12 17:35:49 +03:00
Johan Wikman
776f199d01 MXS-1719 Treat # comments the same way as -- comments
sqlite does not treat # as the start of a to-end-of-line
comment. It cannot trivially be treated as such because at
startup sqlite parses statements containing the #-character.
Thus, only after sqlite has been initialized can it be treated
the same way as --.
2018-06-12 17:35:49 +03:00
Johan Wikman
8f9bf100e1 MXS-1918 Remove HASHTABLE from dcb.cc 2018-06-12 17:32:35 +03:00
Johan Wikman
ee03ffd7db MXS-1917 Replace HASHTABLE with std::set 2018-06-12 17:32:01 +03:00
Johan Wikman
f5f454a29b MXS-1884 Clarify what a list means 2018-06-12 17:29:00 +03:00
Johan Wikman
f87fc45511 MXS-1884 Wrap lines of readconnroute documentation
No other changes.
2018-06-12 17:29:00 +03:00
Marko
de1f95028b MXS-591 Add filter for injecting comments
Comments specified in the cnf file will be injected as a comment before
every sql statement.
2018-06-12 15:31:18 +03:00
Johan Wikman
69b19d1473 Remove unnecessary includes of hashtable.h
And add where necessary.
2018-06-12 11:02:29 +03:00
Johan Wikman
6cc03afdf9 MXS-1908 Reorder the code slightly 2018-06-12 10:49:05 +03:00
Johan Wikman
9a11394f22 MXS-1908 Rename classes
- MessageStats      -> MessageRegistry
- MessageStatsKey   -> MessageRegistryKey
- MessageStatsValue -> MessageRegistryStats
2018-06-12 10:49:05 +03:00
Johan Wikman
690999c4af MXS-1908 Turn LM_MESSAGE_STATS into a class 2018-06-12 10:49:05 +03:00