8702 Commits

Author SHA1 Message Date
Markus Mäkelä
944a5bd9c1 Only extract successful PS responses
If a prepared statement fails to execute on a backend server, no prepared
statement ID is returned. As the connection to the slave backend will be
closed when the result of a session command differs from the master's
response, there's no need to even attempt extracting the response.

This change avoids the triggering of a false positive in
mxs_mysql_extract_ps_response when an attempt to extract a
COM_STMT_PREPARE response is made on a response that isn't a
COM_STMT_PREPARE response.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
9f31b746a0 Create rules directory in mxs1110_16mb
The test uses the dbfwfilter but it does not create the directory where
the rules are stored.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
7082edc4ed Also extract SQL from COM_STMT_PREPARE
COM_STMT_PREPARE contains the plain-text prepared statement so it can be
extracted as if it were a COM_QUERY command.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
2d590308b6 Set current command when executing queued queries
When readwritesplit is routing any queued queries, the currently executed
command of the protocol modules needs to be adjusted by
readwritesplit. This is not a true fix but more of a workaround to fix the
problems of queued query execution.

The correct solution would be to move the queued query handling into the
client protocol module so that all components see the same state.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
bfeaceb070 Assert that only complete COM_STMT_PREPARE responses are returned
Asserting that only a complete COM_STMT_PREPARE is returned when the
prepared statement preparation is extracted will guarantee that the
protocol works as expected.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
30f92ebb4b Only pre-process the current statement
If a statement is about to be queued, there's no need to fully parse it
when it will be done again once the current command being executed
finishes.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
14920fef6c Enable info log for mxs1110_16mb
The info log should help resolve why MaxScale crashes with a debug
assertion.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
b1859cc7a5 Speed up lots_of_rows
The test inserted 200k rows with autocommit enabled which made it very
slow. Wrapping the inserts inside a transaction gives the test a
significant speed boost.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
54f4c6ff73 Clean up binlog_semisync
Removed unnecessary newlines and for loops that were executed only once.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
ba47d80efa Only test edge cases in different_size tests
The tests should only test the cases when the payload size changes the
number of packets the query generates. This involves generating only one
packet, one full packet and one partial packet and one full packet and one
empty packet. These cases should cover all reasonable edge cases and
further testing doesn't seem to provide any significant benefit.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
fbc1a7d44b Fix handling of multi-packet queries in readwritesplit
If a prepared statement sends large amounts of data, the target server
where the data is sent will be tracked. The tracked target was not reset
after a multi-packet query was completed and the target itself was used to
check whether the session was processing a multi-packet query.

Changed the check to use the boolean variable instead of the target and
added a reset of the tracked target after a multi-packet query was
completed.
2017-09-25 10:46:44 +03:00
MassimilianoPinto
845b59ad48 Fix buffer size for testbinlog.c
Fix buffer size for testbinlog.c
2017-09-21 11:01:55 +02:00
Markus Mäkelä
eb0f8ef25d Drop unused databases
The test code should drop any databases that it creates. Also fixed the
typo in the database name.
2017-09-21 09:42:38 +03:00
Markus Mäkelä
595827f9f0 Clean up pers_01 test
The test used an unnecessary timeout in places where one is not
expected. It also restarted MaxScale with no apparent reason.
2017-09-21 09:36:50 +03:00
Markus Mäkelä
cda1fdc26a Refactor fwf_syntax
Use stack allocated classes, check return value of the start command and
combine the rule creation function.
2017-09-21 09:36:50 +03:00
Markus Mäkelä
049eb68254 Combine redundant dbfwfilter tests
The fwf test now only tests the functionality of the rules themselves, not
the parsing. The fwf_syntax test handles the testing of the parser. The
fwf2 test was removed as it was almost identical with the original fwf
test.
2017-09-21 09:36:50 +03:00
Markus Mäkelä
773bae1615 Speed up testing
Removed unnecessary sleeps from tests that appear to serve no
purpose. Moveed the kerberos code from the general startup routines to the
kerberos test.
2017-09-21 09:36:50 +03:00
Markus Mäkelä
20bfe16d11 Remove unnecessary sleeps
Every time MaxScale was restarted, the test waited for a total of 25
seconds. As MaxScale should start before the command returns, the sleep is
not necessary.

Added StartLimitBurst=0 to the systemd service file to allow rapid
restarts of MaxScale.
2017-09-21 09:36:50 +03:00
Johan Wikman
17f6edbfc0 Fix links
The link syntax was the wrong way around.
2017-09-20 14:21:03 +03:00
MassimilianoPinto
825e1478a1 MXS-1423: CHANGE MASTER TO tests with GTID option set
MXS-1423: CHANGE MASTER TO tests with GTID option set
2017-09-20 10:44:19 +02:00
Johan Wikman
1b009f94cf Merge branch '2.1' into develop
MXS-1377
2017-09-20 11:08:48 +03:00
Johan Wikman
9d9cffe4c7 MXS-1377 Always delete the pid-file
Earlier the pid-file was deleted only if the MaxScale startup
succeeded and MaxScale exited in normal fashion.
2017-09-20 10:57:13 +03:00
Johan Wikman
b5ec55dea8 Update version to 2.1.9 2017-09-20 10:51:48 +03:00
Markus Mäkelä
68bcd00a22 Merge branch '2.1' into develop 2017-09-20 10:47:53 +03:00
Johan Wikman
8ff0c0ad6d Update release date 2017-09-20 10:01:27 +03:00
Johan Wikman
3936c71e11 Add missing includes 2017-09-19 15:46:13 +03:00
Markus Mäkelä
1067e76121 Fix CMake variables of cdc_connector
The library is not a static library but a shared object.
2017-09-19 11:18:21 +03:00
Markus Mäkelä
a26f6f6087 Make run_session_hang.sh shorter
The test was unnecessarily long.
2017-09-19 10:11:42 +03:00
Markus Mäkelä
364789abde MXS-1404: Add experimental Group Replication monitor
The monitor performs simple monitoring of a group replication cluster. It
expects no extra parameters in addition to the common monitor parameters
and will only set master and slave status bits on the servers. It is a
part of the experimental package as it is a very experimental module.

Further improvements would be to add the usage of the synced state.
2017-09-19 09:50:29 +03:00
Markus Mäkelä
6b22865f7d MXS-1413: Make the library dynamic
The static library cannot be linked to the Jansson static library by
CMake. This appears to be a limitation in CMake and a manual combination
of the two files would be required.

For the time being, the connector is only built as a shared library.
2017-09-19 06:55:49 +03:00
Markus Mäkelä
062a358077 MXS-1413: Make the CDC connector a standalone library
The library is still located in the test directory but the way it is now
built allows it to be used like a standalone library
2017-09-19 06:55:49 +03:00
Markus Mäkelä
3541d6e0a4 MXS-1413: Add row processing to cdc_connector
The connector now processes rows into objects which expose the values and
types of each returned row.
2017-09-19 06:55:49 +03:00
Markus Mäkelä
36ec6e443e MXS-1413: Use JSON_ALLOW_NUL when loading JSON
The cdc_result.cpp uses json_loads to extract the JSON and JSON_ALLOW_NUL
needs to be added to allow null unicode characters to be extracted.
2017-09-19 06:55:49 +03:00
Markus Mäkelä
52da6c0214 MXS-1413: Move cdc_connector into a subdirectory
Moved the cdc_connector into a subdirectory to distinct it from the other
test sources.
2017-09-19 06:55:49 +03:00
Markus Mäkelä
15c16e378b Add fixed bugs to 2.1.8 release notes
Added MXS-1418 and MXS-1409 to release notes.
2017-09-18 23:12:01 +03:00
Markus Mäkelä
e8a9a393ae Fix bug and issue list scripts
The scripts now properly handle quoted CSV values with the help of a Perl
script.
2017-09-18 22:57:37 +03:00
Markus Mäkelä
aaa60d37e6 Add missing parameter documentation to maxrows
Documented new parameters.
2017-09-18 22:03:30 +03:00
Markus Mäkelä
d72375ebb5 Reset resultset offset when discarding response
The offset into the resultset buffer needs to be reset before each
processed packet if the resultset is being discarded.
2017-09-18 20:51:52 +03:00
Markus Mäkelä
d168493ddf Fix maxrows offset calculation
The code that handles the resultset rows added the extra offset given as a
parameter into the total offset when it should've be ignored.
2017-09-18 20:32:28 +03:00
Markus Mäkelä
a4bad5ffd2 Use shorter timeouts in mxs1323_retry_read
The configuration for mxs1323_retry_read now uses shorter timeouts for
monitors. This should help the monitors detect the server failures before
the result of the SELECT returns. also increased the time the query sleeps
before returning.
2017-09-18 13:46:20 +03:00
Markus Mäkelä
a6a7249cb5 Add new monitor script variables to release notes
Added a section about the new variables into the release notes.
2017-09-18 13:25:26 +03:00
Markus Mäkelä
ab777c76c7 Add CHILDREN to monitor scripts
The CHILDREN parameter expands to a list of server IPs and ports that are
direct descendants of the server that initiated the event.

Also added a note that the variables can expand to empty strings if
nothing matches the criteria of the variable.
2017-09-18 13:12:17 +03:00
Markus Mäkelä
9080072de5 Add PARENT variable to monitor scripts
The scripts now replace the PARENT variable with the IP and port of the
server that is the direct parent node of the server that initiated the
event. For master-slave clusters, this will be the master IP if the server
that triggered the event is a slave.
2017-09-18 13:00:02 +03:00
Markus Mäkelä
6794b35eb0 Remove Python SQL tests
The tests that involved SQL weren't run and did not really test what was
intended to be tested; the use of a Java Connector with MaxScale.
2017-09-18 11:40:43 +03:00
Markus Mäkelä
bd3e2904e7 MXS-1405: Log subprocess output according to log level
If the executed subprocess prefixes its output with either `error:`,
`warning:` or `info:`, the message will be logged on the appropriate
level. If no prefix is provided, the message is logged on the notice
level.
2017-09-18 11:39:33 +03:00
Markus Mäkelä
130b686d9b MXS-1405: Log subprocess output immediately
When the subprocess outputs a line, the message should be logged
immediately. This allows automated timestamps for the output of the
executed subprocess.
2017-09-18 11:39:33 +03:00
Markus Mäkelä
7e6e8d3e29 MXS-1405: Capture subprocess output
The output by the subprocesses launched by the externcmd system is now
captured and logged.
2017-09-18 11:39:33 +03:00
Markus Mäkelä
eab7b7e2a3 Remove call to qc_sqlite_thread_end in qc_sqlite_process_end
Since the thread initialization was removed from the process
initialization function, the thread finish function should not be called
in the process finish function.
2017-09-17 11:55:12 +03:00
Markus Mäkelä
3f0a738e08 Increase timeouts for tests
bug507 and bug519 had relatively low timeouts which seem to be triggered
quite often.
2017-09-17 10:47:06 +03:00
Markus Mäkelä
d003983e5a MXS-1409: Improve MaxAdmin error messages
If both socket and network options are listed, a clear error message is
printed. The usage is also split into two lines to make it clear that the
options should be used separately.
2017-09-16 07:44:25 +03:00