10085 Commits

Author SHA1 Message Date
Johan Wikman
254084fc5e MXS-1935 Accept "PREPARE name FROM @var" 2018-06-21 12:51:47 +03:00
Johan Wikman
457d74f6b4 MXS-1935 Add test that exposes problem
"PREPARE a FROM @var" is not classified.
2018-06-21 12:51:47 +03:00
Johan Wikman
45bda0f72e MXS-1936 Make qc_mysqlembedded compatible with qc_sqlite
qc_mysqlembedded must also be updated to handle the new type
QUERY_TYPE_DEALLOC_PREPARE. Some adjustements were also needed
elsewhere.
2018-06-21 12:51:47 +03:00
Markus Mäkelä
9e4b86ff0a
MXS-1935: Accent NULL from qc_get_preparable_stmt in readwritesplit
If the prepared statement cannot be extracted from the query, treat it as
a query with an unknown type.
2018-06-21 10:04:34 +03:00
Markus Mäkelä
067bca6e58
Document comment syntax
Documented comment syntax and explicitly stated that trailing comments are
not supported.
2018-06-20 20:59:58 +03:00
Markus Mäkelä
14e03613a0
MXS-872: Use the new query only when privileges are OK
If the service user does not have adequate grants to the mysql tables, the
legacy query is used. This prevents an upgrade failure when the user was
lacking the new privileges.
2018-06-20 14:41:56 +03:00
Markus Mäkelä
0914f67175
MXS-872: Document new grant requirement
The user now requires SELECT privileges on the mysql.roles_mapping
table.

Currently this is a mandatory grant but it needs to be made into an
optional requirement. This allows upgrades from 2.2.9 to 2.2.10 without
needing new grants.
2018-06-20 14:41:56 +03:00
Markus Mäkelä
7a0a6c3af1
MXS-1932: Add test case
Added test case that reproduces the problem and verifies that it is fixed.
2018-06-20 14:41:56 +03:00
Markus Mäkelä
28ae1bf24e
MXS-1932: Ignore hidden files in maxscale.cnf.d
All files that are hidden (i.e. start with a period) are now ignored by
the configuration file processing.
2018-06-20 14:41:55 +03:00
Johan Wikman
5d4b3bc419 MXS-1887 Prevent gwbuf_copy_data() performance hit
The cache filter walks through the resultset in order to detect
when the resultset ends. That is, it reads each packet header as
they arrive.

In case the resultset is large, the cache will have to read several
packet headers. That it does using gwbuf_copy_data(). However, as that
was done using the first received GWBUF as the starting point, it meant
that in gwbuf_copy_data() the buffer chain was walked over and over
and over again, with a significant performance hit as the result.

Now we separetely store the last buffer received, and the the starting
offset of it. That way there will be no buffer chain walking.

As this is a common problem, GWBUF could cache the offset of the tail,
thus removing the performance penalty if you read from an offset that
happens to be in the tail. However, it's better to do that as a part
of a general overhaul of GWBUF.
2018-06-20 12:45:22 +03:00
Markus Mäkelä
980caa5be5
MXS-1926: Ignore server shutdown errors
If the server sends a server shutdown error, it is safe for readwritesplit
to ignore it. When the TCP connection is closed, the router error handling
will discard the connection, optionally replacing it.
2018-06-20 00:34:16 +03:00
Markus Mäkelä
b018781764
MXS-872: Add support for roles
The users query for the MySQLAuth now handles users with default roles.
2018-06-19 12:52:00 +03:00
Markus Mäkelä
bf4673d3f7
MXS-872: Add role test case
The test case checks whether roles work via MaxScale.
2018-06-19 12:51:55 +03:00
Markus Mäkelä
8eaa265168
MXS-1931: Remove use of gw_MySQL_get_next_packet
The function implemented redundant functionality and replacement with
modutil_get_next_MySQL_packet was planned.

When faced with a packet header spread over multiple buffers, the packet
length calculation would read past the buffer end. This is fixed by taking
modutil_get_next_MySQL_packet into use.

Identical behavior to the old function is achieved by calling
gwbuf_make_contiguous for each packet to store them in a contiguous area
of memory. This should be either removed and only done when
RCAP_TYPE_CONTIGUOUS_INPUT is requested or be made an innate feature of
statement based routing.
2018-06-18 20:42:23 +03:00
Markus Mäkelä
45f39e7fdd
Wait for monitor in mxs1719
Replaced hard-coded sleep with dynamic waiting.
2018-06-18 14:10:27 +03:00
Markus Mäkelä
6df0804e70
Add missing tls-passphrase documentation
The tls-passphrase was not documented in MaxCtrl. Also regenerated the
documentation.
2018-06-18 11:32:28 +03:00
Markus Mäkelä
24bb8b0b2c
Clean up mxs548_short_session_change_user
The test unnecessarily did an unconditional drop of the user resulting in
errors. Also prevented stopping of MaxScale if it wasn't started in the
first place.
2018-06-18 11:32:28 +03:00
Markus Mäkelä
2ad8b77f11
Fix current command tracking in MariaDBClient
The debug assertion introduced by commit 3d1c2b421a fails when a
COM_CHANGE_USER was executed. This was caused by the fact that the
authentication data was being interpreted as a command when it should've
been ignored.

Added a debug assertion into the reauthentication code to make sure the
current command remains the same.
2018-06-18 11:32:28 +03:00
Markus Mäkelä
ca155fbfe9
Merge branch '2.1' into 2.2 2018-06-18 11:32:13 +03:00
Markus Mäkelä
d923042115
MXS-1930: Fix server version checks
The server versions now checks for 10.3 when deciding whether to send new
capabilities.
2018-06-18 10:55:39 +03:00
Esa Korhonen
09df017528 MXS-1886 Better auto-rejoin error description and tolerance
Auto-rejoin now explains more accurately if a server cannot be joined due
to conflicting gtid.

Also, auto-rejoin is no longer disabled if a join fails. Usually the fail
is due to the server not replying fast enough with query completion. The
query is often completed anyways. This can lead to some log spam.
2018-06-15 13:11:10 +03:00
Esa Korhonen
9e68d8ec3d MXS-1886 Auto-failover error tolerance
Auto-failover is no longer considered to have failed if the preconditions
are not met. An error message with the failed checks is printed once, but
the checks are repeated every loop as long as the master is down.
2018-06-15 12:52:03 +03:00
Markus Mäkelä
a983df5a7e
Fix testlogthrottling compilation failure
The ifstream constructor for some reason doesn't understand strings.
2018-06-15 11:45:40 +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ä
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
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
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
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ä
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
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
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
dapeng huang
cd136b11a7 MXS-1891: dealloc named prepare should route to all (#174)
* dealloc named prepare route to all

* add newline

* erase from ps manager too

* little refactor
2018-06-12 10:45:11 +03:00
Markus Mäkelä
1a24f0a956
Merge branch '2.1' into 2.2 2018-06-11 10:36:57 +03:00
Markus Mäkelä
283a6d564e
Update MaxCtrl dependencies
Updated various npm dependencies of MaxCtrl. Also updated the testing
docker-compose image to use 10.2.
2018-06-11 09:17:02 +03:00
Markus Mäkelä
1e1734f42e
MXS-1910: Only require ssl_ca_cert for servers
Servers in MaxScale can encrypt the connections without client keys and
certificates. As keys and certificates are no longer required, the CA
certificate must always be initialized.
2018-06-09 00:15:48 +03:00
Markus Mäkelä
a7dd2127d6
Merge branch '2.1' into 2.2 2018-06-08 11:21:35 +03:00
Markus Mäkelä
c850336199
MXS-1907: Allow ssl_verify_peer_certificate when creating listener
When a listener is created at runtime or SSL is being enabled for an
already created listener, the ssl_verify_peer_certificate parameter can
now be defined.
2018-06-08 10:11:43 +03:00
Markus Mäkelä
6ba423cf94
Dump statements on unexpected internal state
If a server responds when no response was expected, dump stored
statements. This should help deduce root causes of problems relating to
unexpected responses.
2018-06-08 07:45:18 +03:00
Markus Mäkelä
d0feff5eb3
Wait for a number of monitor intervals in tests
The tests can now wait for a number of monitor intervals. This removes the
need to have hard-coded sleeps in the code and makes monitor tests more
robust under heavier load.
2018-06-08 07:45:18 +03:00
Markus Mäkelä
7be11af911
Fix release documentation
Copied the contents of the pull request to the wrong repo to the correct
one.
2018-06-08 07:45:18 +03:00
Markus Mäkelä
600d459079
Fix attribute assignment in mxs1824_double_cursor
Used correct type, checked for return value.
2018-06-08 07:45:18 +03:00
Markus Mäkelä
238a00f29d
Set mysqlmon timeouts to 10 seconds
The backend timeouts should help prevent disconnections.
2018-06-08 07:45:18 +03:00