8844 Commits

Author SHA1 Message Date
Markus Mäkelä
ecb56ef540 Use references instead of copies of SRWBackend
As the DCB passed as the clientReply parameter is guaranteed to match one
of the DCBs in the RWBackends. By using a reference, the need to copy a
shared_ptr is removed (along with the atomic operation that it implies)
thus reducing the overhead in the clientReply and the functions it uses.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
a6eeed98fe Fix handling of collected results
The result collection did not reset properly when a non-resultset was
returned for a request. As collected result need to be distinguishable
from single packet responses, a new buffer type was added.

The new buffer type is used by readwritesplit which uses result collection
for preparation of prepared statements.

Moved the current command tracking to the RWBackend class as the command
tracked by the protocol is can change before a response to the executed
command is received.

Removed a false debug assertion in the mxs_mysql_extract_ps_response
function that was triggered when a very large prepared statement response
was processed in multiple parts.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
948f66f918 Make each packet contiguous for RCAP_TYPE_STMT_OUTPUT
As each packet is routed separately, they must be made contiguous before
routing them.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
6c5fa071d5 Inline backend related functions
Inlined the getter/setter type functions that are often used. Profiling
shows that inlining the RWBackend get/set functions for the reply state
manipulation reduces the relative cost of the function to acceptable
levels. Inlining the Backend state function did not have as large an
effect but it appears contribute a slight performance boost.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
a8cf5998dd Use custom result set detection functions
The functions that the readwritesplit uses can assume that the buffer
contains only one packet in contiguous memory.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
7840c86b7f Remove unnecessary result processing in readwritesplit
The result processing code did unnecessary work to confirm that the result
buffers are contiguous. The code also assumed that multiple packets can be
routed at the same time when in fact only one contiguous result packet is
returned at a time.

By assuming that the buffers are contiguous and contain only one packet,
most of the copying and buffer manipulation can be avoided.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
8085ee15be Fix GCC7 warnings in cache filter
The thread count did not have enough space for a INT_MAX.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
1b6e5baa56 Fix GCC7 warnings in binlogrouter
GCC7 reported possible destination buffer overflow in binlogrouter.
2017-10-12 12:29:43 +03:00
Johan Wikman
5a585b1c8a Fix buffer overflow in test program 2017-10-12 12:29:43 +03:00
Johan Wikman
73e41e8eb9 Update bug-list of MaxScale 2.2.0 release notes 2017-10-12 12:29:43 +03:00
Johan Wikman
c4439bc657 Update Change Log for 2.2 2017-10-12 12:29:43 +03:00
Markus Mäkelä
07f166ed8c Fix issue processing script
The script now properly processes repeating commas inside double quotes.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
9a743ec9f3 Add note about MaxCtrl to release notes
Added a note about MaxCtrl in the release notes.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
5521c84258 Fix GTID setup in tests
The GTID setup in tests executed code that was not supposed to be executed
when GTID is in use.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
fa25f5aba8 Fix sync_slaves
The function did not check whether the file name was valid.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
16530b4a97 Clean up setup_binlog_gtid
Removed redundant operations and cleaned up unused code.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
8be898d1d3 Disable multi-MaxScale initialization by default
Only tests that require multiple MaxScale instances should enable the
multi-MaxScale mode.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
81dba9767c Order member variable initialization in TestConnections
The variables are now initialized in order and always in the constructor.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
40cbf37d64 Add example to REST API module command documentation
Added an example that demonstrates how to call a module command with
parameters via the REST API.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
7b261ac99d Use absolute paths in kerberos_setup
The files were located in the vagrant user's home directory but superuser
access is needed to copy them into /etc.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
e58f6d6317 Add methods for changing the active MaxScale instance
The new function allows two MaxScale instances to be controlled via the
same TestConnections object. This will allow testing of Maxscale clusters.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
65b4612ff4 Run smoke tests by default
The tests are now run as the shorter version by default.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
1521bae3b5 Use new MaxScale object names in mxs1457_ignore_deleted
The names of the monitors and services in tests that use MaxScale 2.2 need
to use the hyphen-transformed versions of the object names.
2017-10-12 12:29:43 +03:00
Markus Mäkelä
8a55bbfca8 Fix typo in IP testing database
The test had a typo in the SQL that created the database so the later
queries that referred to it always failed.
2017-10-12 12:29:43 +03:00
MassimilianoPinto
69cddb2695 MXS-1466: Add support for new variables: @@log_bin, @@max_connections, @@gtid_strict_mode etc
MXS-1466: Add support for new variables: @log_bin, @@max_connections,
@@gtid_strict_mode etc
2017-10-09 18:57:23 +02:00
Johan Wikman
df816ea2a9 MXS-1460 Add failover_script parameter
The failover script can now be specified in the configuration file.
2017-10-03 15:24:29 +03:00
Markus Mäkelä
613994ca8a Merge branch '2.2' into 2.2-mrm 2017-10-03 15:15:39 +03:00
Markus Mäkelä
54a7051a3f Fix tests broken by the merge
The merge caused compilation failures in two of the files.
2017-10-03 15:14:06 +03:00
Markus Mäkelä
8c3c103060 Merge branch '2.2' into 2.2-mrm 2017-10-03 14:52:21 +03:00
Markus Mäkelä
7ca8db14de MXS-1444: Add monitor parameter alteration
The parameter handling for monitors can now be done in a consistent manner
by establishing a rule that the monitor owns the parameter object as long
as it is running. This will allow parameters to be added and removed
safely both from outside and inside monitors.

Currently this functionality is only used by mysqlmon to disable failover
after an attempt to perform a failover has failed.
2017-10-03 14:50:20 +03:00
Markus Mäkelä
4ee5c991c2 MXS-1452: Extend kill parsing test
The test now correctly checks for usernames and integer overflow.
2017-10-03 14:47:16 +03:00
Markus Mäkelä
96d160f897 MXS-1452: Add support for KILL USER <name>
Added support for killing queries by username. This will kill all
connections from that particular user on all servers.
2017-10-03 14:47:16 +03:00
Markus Mäkelä
4150dee952 Extend KILL parsing test
Added test cases for `KILL [ HARD | SOFT ] [CONNECTION | QUERY ]`.
2017-10-03 14:47:16 +03:00
Markus Mäkelä
49b179bf69 Add HARD/SOFT to executed KILL commands
The HARD and SOFT keywords are parsed and added to the executed KILL
commands.
2017-10-03 14:47:16 +03:00
Markus Mäkelä
4dd6842447 Send KILL commands to backends
KILL commands are now sent to the backends in an asynchronous manner. As
the LocalClient class is used to connect to the servers, this will cause
an extra connection to be created on top of the original connections
created by the session.

If the user does not have the permissions to execute the KILL, the error
message is currently lost. This could be solved by adding a "result
handler" into the LocalClient class which is called with the result.
2017-10-03 14:47:16 +03:00
Markus Mäkelä
a7e610a70a Extract shared session information in LocalClient constructor
When the LocalClient is constructed, it is possible to extract all the
needed information at that time. The only obstacle is the fact that the
LocalClient is constructed at the same time the session is. Since the
client DCB is created before the session, it is safe to extract the shared
data directly from it.
2017-10-03 14:47:16 +03:00
Markus Mäkelä
cd83aa40db Stop monitors first when shutting down
As monitors aren't synchronized with the worker threads, they need to be
shut down first.
2017-10-03 14:47:16 +03:00
Markus Mäkelä
27d1be7f96 Merge branch '2.2' of github.com:mariadb-corporation/MaxScale into 2.2 2017-10-03 14:46:14 +03:00
Markus Mäkelä
bd39284f9c Merge branch '2.1' into 2.2 2017-10-03 14:30:06 +03:00
Johan Wikman
267a45ad63 MXS-1441 Add switchover_script parameter
If a switchover_script parameter is given, its value will be used as
the switchover script. Otherwise the default will be used. Currently
just echo.

The MySQL Monitor now introduces two script variables, CURRENT_MASTER
and NEW_MASTER, that contain information about the current and new
master respectively.

Switchover is performed only if switchover has been enabled and MaxScale
is *not* in passive mode.
2017-10-03 13:51:08 +03:00
Markus Mäkelä
9280f1a5d7 MXS-1367: Add timeouts for retried queries
The total timeout for the retrying of interrupted queries can now be
configured with the `query_retry_timeout` parameter. It controls the total
timeout in seconds that the query can take.

The actual connection, read and write timeouts of the connector aren't a
good configuration value to use for abstracted queries as the time that it
takes to execute a query can be composed of both connections, reads and
writes. This is caused by the usage of MYSQL_OPT_RECONNECT that hides the
fact that the connector reconnects to the server when a query is
attempted.
2017-10-03 13:03:49 +03:00
Markus Mäkelä
67ef7bd058 MXS-1367: Take mxs_mysql_query into use
The use of a wrapper function allows automated retrying of the queries
without requiring any changes to the code that uses it.
2017-10-03 10:57:12 +03:00
Markus Mäkelä
f1f8a4b5b2 MXS-1367: Retry interrupted queries
The new `query_retries` parameter controls how many times an interrupted
query is retried. This retrying of interrupted queries will reduce the
rate of false positives that MaxScale monitors detect.
2017-10-03 10:57:10 +03:00
Johan Wikman
17c3d1e612 MXS-1441 Make externcmd_allocate const correct 2017-10-03 10:45:37 +03:00
Johan Wikman
cf0a87e7f2 MXS-1441 Expose monitor_launch_command
So that a specific monitor may create the command and replace
monitor specific script variables before giving the command
for execution.
2017-10-03 10:32:42 +03:00
Johan Wikman
8d1c4bdd56 MXS-1441 Use monitor_launch_script for performing switchover
To be able to do that, we need to get hold of the MXS_MONITORED_SERVER
corresponding to the SERVER specified as the new master.

So, instead of just return a boolean indicating whether the server was
found or not we return the MXS_MONITORED_SERVER pointer.
2017-10-03 09:28:42 +03:00
Johan Wikman
e295d438d4 MXS-1441 Expose monitor_launch_script
So that it can be called directly from a monitor.
2017-10-03 09:19:23 +03:00
Johan Wikman
f29d8209cc MXS-1441 Create proper json error objects 2017-10-02 16:08:12 +03:00
Johan Wikman
e41f60fd2e Add mxs_json_error_append
Using this function, more error object can be added to the error
array of an json error object.
2017-10-02 16:08:12 +03:00
Johan Wikman
438b4e0341 Merge branch '2.2' into 2.2-mrm 2017-10-02 15:49:08 +03:00