Commit Graph

9254 Commits

Author SHA1 Message Date
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
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
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
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
1b6e5baa56 Fix GCC7 warnings in binlogrouter
GCC7 reported possible destination buffer overflow in binlogrouter.
2017-10-12 12:29:43 +03:00
5a585b1c8a Fix buffer overflow in test program 2017-10-12 12:29:43 +03:00
73e41e8eb9 Update bug-list of MaxScale 2.2.0 release notes 2017-10-12 12:29:43 +03:00
c4439bc657 Update Change Log for 2.2 2017-10-12 12:29:43 +03:00
07f166ed8c Fix issue processing script
The script now properly processes repeating commas inside double quotes.
2017-10-12 12:29:43 +03:00
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
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
fa25f5aba8 Fix sync_slaves
The function did not check whether the file name was valid.
2017-10-12 12:29:43 +03:00
16530b4a97 Clean up setup_binlog_gtid
Removed redundant operations and cleaned up unused code.
2017-10-12 12:29:43 +03:00
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
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
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
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
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
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
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
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
6e4cb3b293 Update release date 2017-10-12 11:16:34 +03:00
eac6d239fc MXS-1468: Fix created monitor serialization
When servers were added to monitors that were created at runtime, the
server list serialization overwrote the original persisted configuration
of the monitor. To solve this problem, the serialization of the server
list and the monitor parameters were combined.
2017-10-11 11:30:58 +03:00
e94dc2aade MXS-1468: Add test case
Added test case that reproduces the bug.
2017-10-11 11:29:02 +03:00
fc488ee278 Update release notes 2017-10-11 09:27:01 +03:00
88325a9d36 Fix resultset handling with binary data
When binary data was processed, it was possible that the values were
misinterpreted as OK packets which caused debug assertions to trigger.

In addition to this, readwritesplit did not handle the case when all
packets were routed individually.
2017-10-11 09:19:40 +03:00
8a69232e26 Fix usage of partial packets when full packets are expected
The authentication phase expects full packets. If the packets aren't
complete a debug assertion would get hit. To detect this, the result of
the extracted buffer needs to be checked.
2017-10-11 09:19:40 +03:00
c3627c83be Fix hang on multi-statemet query
If multiple queries that only generate OK packets were executed, the
result returned by the server would consist of a chain of OK packets. This
special case needs to be handled by the modutil_count_signal_packets.

The current implementation is very ugly as it simulates a result with at
least one resultset in it. A better implementation would hide it behind a
simple boolean return value and an internal state object.
2017-10-11 09:19:40 +03:00
820e86ac7d Fix buffer length calculation in modutil_count_signal_packets
The optimization of the buffer iteration did not decrement the total
buffer length.
2017-10-11 09:19:40 +03:00
f5f39efcdc Update 2.2.0 release notes 2017-10-10 13:37:21 +03:00
42cb6bbff7 Fix multi-statement execution in readwritesplit
A multi-statements can return multiple resultsets in one response. To
accommodate for this, both the readwritesplit and modutil code must be
altered.

By ignoring complete resultsets in readwritesplit, the code can deduce
whether a result is complete or not.
2017-10-10 08:25:18 +03:00
d9922ac895 Fix debug assertion in modutil_count_signal_packets
The original offset needs to be separately tracked to assert that an OK
packet is not the first packet in the buffer. The functional offset into
the buffer is modified to reduce the need to iterate over buffers that
have already been processed.
2017-10-10 07:25:47 +03:00
cdf68ab86e Fix muti-result handling in modutil_count_signal_packets
The function assumed that the buffer would not contain a trailing OK
packet that completes a multi-result response.
2017-10-10 07:14:05 +03:00
139b974306 Add function for logging buffer contents as hex
The gwbuf_hexdump write the contents of the buffer into the info log. This
is quite helpful for debugging of protocol related problems.
2017-10-10 07:11:37 +03:00
30a99b2632 Fix unintentional fallthrough
When LEAST_BEHIND_MASTER routing criteria was used, the info level logging
function would fall through to the default case. In debug builds, this
would trigger a debug assertion.
2017-10-10 06:10:11 +03:00
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
08bdbb45db Add missing initialization of MySQLProtocol::collect_result
The variable was not initialized.
2017-10-09 19:52:35 +03:00
d64cd5cab8 Return results as sets of packets
Returning the results of a query as a set of packets is currently more
efficient. This is mainly due to the fact that each individual packet for
single packet routing is allocated from the heap which causes a
significant loss in performance.

Took the new capability into use in readwritesplit and modified the
reply_is_complete function to work with non-contiguous results.
2017-10-09 19:26:08 +03:00
3015e6c97d Add file names and line numbers to stacktraces
The GLIBC backtrace functionality doesn't generate file names and line
numbers in the generated stacktrace. This can to be done manually by
executing a set of system commands.

Conceptually doing non-signal-safe operations in a signal handler is very
wrong but as stacktraces are only printed when something has gone horribly
wrong, there is no real need to worry about making things worse.

As a safeguard for fatal errors while the stacktrace is being generated,
it is first dumped into the standard error output of the process. This
will function even if malloc is corrupted.
2017-10-09 16:14:36 +03:00
6b7ccea4e3 Fix large_insert_hang compilation failure
Added missing changes that weren't added to last commit.
2017-10-09 16:01:40 +03:00
ede52c8af9 Add OK packet processing test
Added a test case which exercises the OK packet handling in
readwritesplit.
2017-10-09 14:05:38 +03:00
2c2f86cebb Fix OK packet status extraction in readwritesplit
As the row count and last insert ID are length-encoded integers, they need
to be handled with the correct functions.
2017-10-09 13:38:12 +03:00
13265876a9 Add MaxCtrl test for start/stop maxscale
Added the missing test case for starting and stopping MaxScale.
2017-10-09 13:12:30 +03:00
80892c1657 Update MaxCtrl documentation
Fixed the usage help for each command.
2017-10-09 13:12:30 +03:00
9805df7af0 Update Avro router documentation
Update Avro router documentation
2017-10-09 11:00:02 +02:00
c8b9bf09b8 Fix typo in readwritesplit comments
The comment about the static variable being returned as a reference was
missing the `return` word.
2017-10-08 23:28:01 +03:00
75316712e7 Fix error messages in sync_slaves
Fixed missing newlines in the error output printf calls of
sync_slaves. Changed the order of commands pers_02 executes to a more
correct way.
2017-10-08 23:26:22 +03:00
c5ff130b33 Process backend packets only once
When the router requires statement based output, the gathering of complete
packets can be skipped as the process of splitting the complete packets
into individual packets implies that only complete packets are handled.

Also added a quicker check for stored protocol commands than a call to
protocol_get_srv_command.
2017-10-08 23:15:18 +03:00
d97742bf66 Fix crash in backend command tracking
The backend protocol command tracking didn't check whether the session was
the dummy session. The DCB's session is always set to this value when it
is put into the persistent pool.
2017-10-08 22:06:43 +03:00
2ca050156f Fix backend protocol command tracking
If a query was processed in the client protocol module when a prepared
statement was being executed by the backend module, the current command
would get overwritten. This caused a debug assertion in readwritesplit to
trigger as the result was neither a single packet nor a collected result.

The RCAP_TYPE_STMT_INPUT capability guarantees that a buffer contains a
complete packet. This information can be used to track the currently
executed command based on the buffer contents which allows asynchronicity
betweent the client and backend protocol. In practice this only comes in
play when routers queue queries for later execution.
2017-10-08 08:52:53 +03:00