12566 Commits

Author SHA1 Message Date
Johan Wikman
4131f09c16 MXS-2431 Recognize the XA keyword
Recognize the XA keyword and classify the statement as write.
Needs to be dealt with explicitly as sqlite3 assumes there are
no keywords starting with the letter X.
2019-04-12 11:05:15 +03:00
Johan Wikman
62f2a86a5f MXS-2431 Add test that reveals the problem 2019-04-12 10:30:36 +03:00
Markus Mäkelä
1652b18a7b
Fix whitespace in canonicalized queries
Trailing whitespace was not removed and whitespace wasn't normalized to
spaces.
2019-04-12 09:18:07 +03:00
Markus Mäkelä
d2ecaa83a6
Move result start handling into separate function
The largest part of the code deals with the start of a response. Moving
this into a subfunction makes the function clearer as the switch statement
inside a switch statement is removed.
2019-04-12 09:18:07 +03:00
Markus Mäkelä
746bd53668
Simplify RWBackend result handling
By processing the packets one at a time, the reply state is updated
correctly regardless of how many packets are received. This removes the
need for the clunky code that used modutil_count_signal_packets to detect
the end of the result set.
2019-04-12 09:18:05 +03:00
Markus Mäkelä
e6526dd9ea
Add extra info logging to readwritesplit
Added logging into RWBackend reply state processing code to know more.
2019-04-12 09:17:48 +03:00
Markus Mäkelä
bc5f9da6c4
Add classification test case
Also removed the dead code that was never used to get coverage to 100%.
2019-04-09 10:56:38 +03:00
Markus Mäkelä
9a5b60a071
Add forced maintenance mode tests
Tested that the force option works and is accepted.
2019-04-09 10:00:50 +03:00
Markus Mäkelä
0932d10169
Do node checks in parallel
The checking of MariaDB and Galera nodes is now done asynchronously while
the MaxScale check is done which leads to faster testing. Rough
measurements show that doing all the work in parallel reduces test startup
time by two seconds. Most of the time appears to still be in the MaxScale
startup which takes on average three to four seconds per test.
2019-04-09 09:43:19 +03:00
Markus Mäkelä
5e3af05d48
Speed up test startup
The VM connectivity and log truncation is now done in parallel.
2019-04-09 09:43:19 +03:00
Markus Mäkelä
55bb3e9250
Make tests less verbose
The numeric values of the labels aren't of value when inspecting test
results. For this reason, it makes sense to put them behind the verbose
flag to make test framework debugging happen purpose.
2019-04-09 09:43:19 +03:00
Markus Mäkelä
a102efa01f
Backport: Document the force option for set
Added documentation for the new option and mentioned it in the release
notes.
2019-04-09 09:43:19 +03:00
Markus Mäkelä
0cb15976e8
Backport: Add force option to set endpoint
The new `force=yes` option closes all connections to the server that is
being put into maintenance mode. This will immediately close all open
connections to the server without allowing results to return.
2019-04-09 09:43:18 +03:00
Markus Mäkelä
7fb840ac9e
Sort CN_ definitions 2019-04-09 09:43:18 +03:00
Markus Mäkelä
05515cca16
MXS-2259: Limit size of client reads
Given the assumption that queries are rarely 16MB long and that
realistically the only time that happens is during a large dump of data,
we can limit the size of a single read to at most one MariaDB/MySQL packet
at a time. This change allows the network throttling to engage a lot
sooner and reduces the maximum overshoot of throtting to 16MB.
2019-04-05 22:48:16 +03:00
Markus Mäkelä
aad29404c6
Fix parameter value error
The argumets were given in the wrong order.
2019-04-05 13:33:16 +03:00
Markus Mäkelä
b54e67223f
MXS-2423: Add missing parameters to maxscale endpoint
Also updated the REST API documentation to include the newer output
(automating this update would be valuable).
2019-04-05 13:33:16 +03:00
Markus Mäkelä
9722c0887a
Log connection ID when reading server handshake
By logging the connection ID for each created connection, failures can be
traced back from the backend server all the way up to the client
application.
2019-04-05 13:33:16 +03:00
Markus Mäkelä
ec890b33cd
Prevent checksum mismatch on second trx replay
If a transaction replay has to be executed twice due to a failure of the
original candidate master, the query queue could contain replayed
queries. The replayed queries would be placed into the queue if a new
connection needs to be created before the transaction replay can start.
2019-04-05 13:33:16 +03:00
Markus Mäkelä
6421af1bb4
Backport query queue changes to 2.3
Backported the changes that convert the query queue in readwritesplit into
a proper queue. This changes combines both
5e3198f8313b7bb33df386eb35986bfae1db94a3 and
6042a53cb31046b1100743723567906c5d8208e2 into one commit.
2019-04-05 13:33:16 +03:00
Markus Mäkelä
556c83f83a
MXS-2417: Add test case 2019-04-04 08:59:28 +03:00
Markus Mäkelä
b08d4e37b5
MXS-2416: Pass deleter to std::shared_ptr<GWBUF>
As shared_ptr doesn't automatically use std::default_delete<T>, it needs
to be explicitly passed to the constructor.
2019-04-03 12:57:06 +03:00
Markus Mäkelä
09cb4a885f
Fix readconnroute name in examples 2019-04-03 12:57:05 +03:00
Markus Mäkelä
e3e66f8e90
MXS-2417: Add option to ignore persisted configs
The load_persisted_configs parameter now controls whether persisted
runtime changes are loaded on startup. The changes are still generated as
it persists the current state of MaxScale making problem analysis easier.
2019-04-03 12:57:05 +03:00
Markus Mäkelä
a217dde1f0
MXS-2419: Queue queries executed during trx replay
By storing the queries in the query queue and routing it once the
transaction replay is done, we prevent two problems:

* Multiple transaction replays would overwrite the m_interrupted_query
  buffer that was used to store any queries executed during the
  transaction replay.

* Incorrect ordering of queries when the query queue is not empty and a
  new query is executed during transaction replay.
2019-04-03 12:57:05 +03:00
Markus Mäkelä
2dfd7d35ac
MXS-2418: Crash on trx replay when log_info is enabled
If the session starts with no master but later one becomes available, when
a transaction is started the code would unconditionally use the master's
name in a log message.
2019-04-03 12:57:05 +03:00
Timofey Turenko
cd732ac14f
MXS-2243 System tests brings VMs by themselves (#193)
maxscale-system-test changed in order to control test environment by itself.
Every test checks which machines are running, compare with list of needed machines
and start new VMs is they are missing in the running machines list.
Tests are executiong MDBCI commands, MDBCI executable should be in the PATH
2019-04-02 13:27:34 +03:00
Markus Mäkelä
868ae4456c
Merge branch '2.3.5' into 2.3 2019-04-02 12:47:08 +03:00
Markus Mäkelä
366fc6b8ee
MXS-2201: Document static parameters
Documented the list of parameters that cannot be changed at runtime.
2019-04-02 12:45:00 +03:00
Johan Wikman
d6d5c82fc3 Merge branch '2.3.5' into 2.3 2019-04-02 12:35:23 +03:00
Johan Wikman
b42d38a3f6 Update release date 2019-04-02 12:34:11 +03:00
Johan Wikman
09c7183a2b Update 2.3 maintenance version 2019-04-02 12:25:11 +03:00
Markus Mäkelä
5f02974303
Fix mxs2057_systemd_watchdog
The coredump pattern was wrong.
2019-04-01 21:13:02 +03:00
Johan Wikman
758fec5e2f Update 2.3.5 Change Log and Release Notes 2019-04-01 15:39:59 +03:00
Johan Wikman
0419e358a6 MXS-2393 Turn off 'require_fully_parsed'
Otherwise test program will not pass as some non test-realated
statements are not fully parsed.
2019-04-01 15:38:01 +03:00
Esa Korhonen
9281220e91 Cleanup sharding test
Added a timeout to ensure shard info is updated.
2019-04-01 11:32:48 +03:00
Markus Mäkelä
738ae9178b
Fix binlogfilter matching
The matching always checked the default database when it should only check
it if there are no tables in the statement.
2019-04-01 11:29:16 +03:00
Johan Wikman
06c01439fb MXS-2393 Fix masking test
The masking_user test creates a database over a masked connection.
As 'CREATE DATABASE DB' is not fully parsed the test will fail since
it creates a database.

To allow the test to pass, we turn off the strict requirement that
all statements must be fully parsed.
2019-04-01 10:52:52 +03:00
Johan Wikman
5346b24fa4 MXS-2393 Add parameter 'require_fully_parsed'
If set to true and if any of the other blocking related parameters
is true, then a statement that cannot be fully parsed will be blocked.

Default is true.
2019-04-01 10:52:52 +03:00
Markus Mäkelä
3977207d12
Update transaction_replay documentation
Removed the confusing paragraph.
2019-03-29 14:23:15 +02:00
Johan Wikman
42e658d91f MXS-2403 Fix test program
ERROR 1248 (42000): Every derived table must have its own alias
2019-03-29 11:31:13 +02:00
Markus Mäkelä
48791c3877
Fix duplication of the router parameter
The service parameter list had two router entries in it due to the
assumption that the parameter list never contained the router itself in
it.
2019-03-29 10:35:41 +02:00
Markus Mäkelä
4f8d6d1853
Fix transaction_replay documentation
The documentation stated that MVCC reads weren't safe with
transaction_replay when in reality they are not safe in general and
transaction_replay has no effect on it.
2019-03-29 10:35:41 +02:00
Johan Wikman
514dd96301 MXS-2413 Parse 'DROP DATABASE [IF EXISTS] db' completely 2019-03-29 10:09:38 +02:00
Johan Wikman
24c763d701 Update 2.3.5 release notes 2019-03-28 14:47:31 +02:00
Johan Wikman
dfd1d1e979 Update 2.3.5 release notes 2019-03-28 14:42:20 +02:00
Markus Mäkelä
116efb2409
MXS-2379: Fix maxinfo HTTP interface
Added the missing HTTP request handlers and a new JSON conversion
function.
2019-03-28 14:03:56 +02:00
Markus Mäkelä
0fa7ad8580
Remove excessive memory allocation from dcb_printf
The function allocated a constant-sized chunk of memory for all messages
which was excessive as well as potentially dangerous when used with large
strings.
2019-03-28 14:03:56 +02:00
Esa Korhonen
c4b82b7d83 MXS-2359 Route statements with database but no table dependence
Queries such as SHOW TABLES FROM db1 are now routed to the backend with db1.
This gives the correct result as long as db1 is not sharded to multiple
backends.
2019-03-27 13:46:36 +02:00
Esa Korhonen
ee88180c54 MXS-2409 Check that prepared statement exists
If the PREPARE is malformed, the extracted statement is null.
2019-03-27 13:46:36 +02:00