Commit Graph

12169 Commits

Author SHA1 Message Date
6f5d089131 Use expect in mxs1947_composite_roles
`assert` was renamed to `expect`.
2018-09-12 22:09:38 +03:00
96a78685bc Fix possible buffer overrun in readwritesplit
If the GWBUF length was larger than the stack buffer length, the code
would write past the buffer.
2018-09-12 22:09:38 +03:00
f6840fbded Remove implicit initialization of all maxscales
The extra maxscale instances are only started if the test explicitly
requests it.
2018-09-12 22:09:38 +03:00
643480240c Simplify MaxCtrl version extraction
Instead of using the correct version in in-source builds, a dummy file is
copied in place. This removes the need to explicitly include the
VERSION.cmake file.
2018-09-12 22:09:37 +03:00
077f344a20 MXS-2037 Add test case 2018-09-12 20:59:47 +03:00
12092d1a90 test_cycle_find.cc: Initialize the log 2018-09-12 14:23:09 +03:00
1bffb1c26d Fix release note generation script
The CMake command that reads the VERSION.cmake file needs to be executed
in the source root.
2018-09-12 11:05:17 +03:00
d04c7135b0 Update change log and release notes 2018-09-12 09:43:36 +03:00
d881630204 Allow programatic control of galera restarting
If a test program needs other than the default Galera config
(e.g. log_slave_updates enabled), then it should be able to
programmatically cause galera to be restarted as part of the
TestConnections construction.
2018-09-12 09:09:52 +03:00
9b0f016aba Fix minor formatting oversights
Code that was not formatted was merged into develop unformatted.
2018-09-12 08:58:15 +03:00
65c50ca8b7 Fix uncrustify script
Add explicit path to the root source directory and allow invocation from
other directories. Also included qc_sqlite sources but excluded the SQLite
sources. Explicitly define the configuration in the MaxScale sources as
the one that will be used.

Changed from N invocations of uncrustify to one invocation with all files
as the program arguments. This should give a slight speedup when
formatting all sources.
2018-09-12 08:58:15 +03:00
d7b7f43efb Rename misleading function
The expecting resultset function does not expect a resultset but a text
protocol result.
2018-09-12 08:44:31 +03:00
e15b0e2147 MXS-2041: Fix crash on failed schemarouter session
When the setting up of filters for a session fails, the DCB is closed and
the client DCB's session pointer is set to NULL. This needs to be checked
in the schemarouter before the `m_client->session` pointer is used.

The act of setting the session pointer to NULL should not be necessary as
the session is freed once the reference count drops down to zero. Due to
the fact that changing this would require moderate changes in session code
means that it should not be done in a patch release as the risks are too
high.
2018-09-12 08:44:31 +03:00
9c08d78304 Add missing error messages
If tee filter creation fails, it would not log an error message.
2018-09-12 08:44:31 +03:00
81a3c73c74 Fix assert -> expect breakage 2018-09-12 08:39:54 +03:00
fd176c4122 Merge branch '2.2' into develop 2018-09-11 12:57:19 +03:00
c04073a96c MXS-2040 Increase default monitor timeouts
All three timeouts are now three seconds. This should reduce the amount of
timeout errors users get during failover/switchover.
2018-09-11 12:31:41 +03:00
ad71655a36 MXS-2036 Redirect slaves with stopped SQL threads
This is somewhat questionable, as the slaves won't be able to really
replicate from the new master. However, not doing this causes the wrong
master to be selected after failover unless the new master has a majority
of slaves under it.
2018-09-11 10:27:31 +03:00
087272c3e4 fix multistatment hang (#180) 2018-09-11 08:39:12 +03:00
c878146c24 MXS-1947: Add test case
The test checks that composite roles work.
2018-09-10 21:47:47 +03:00
889877c0ab MXS-1947: Add support for composite roles
Added support for composite roles for 10.2 and newer versions. As
recursive CTEs are required to extract the role mappings, composite roles
aren't supported on 10.1.
2018-09-10 21:47:47 +03:00
9e0042b3b5 Fix symbolic VERSION file
The file is included from locations other than the source root. Due to
this, it needs to be prefixed with ${CMAKE_SOURCE_DIR}.
2018-09-10 21:47:03 +03:00
31f6d49ddb Add symbolic VERSION file
The VERSION.cmake file defines which VERSION.cmake file is included. By
changing the file that it points to, the version can be changed without it
affecting other parts of the code that use it.
2018-09-10 15:11:18 +03:00
8896b0275f Recreate 2.2.14 release notes
Generated the release notes with the release note generation script.
2018-09-10 15:02:15 +03:00
64177276be Automatically generate relese notes
As most of the release notes are "boilerplate text", the changing parts
can be easily scripted.
2018-09-10 15:01:41 +03:00
eed2628cff Rewrite issue listing script
Rewrote the script in python and leveraged the dictionary CSV processor to
prevent field number mismatches. Combined the two scripts into one so that
all user-facing issues that are fixed can be easily shown in the release
notes.
2018-09-10 15:01:29 +03:00
73405c8ff9 Stabilize bug676
The test should now be stabler as it waits for a monitor interval instead
of a set amount of seconds.
2018-09-10 15:01:29 +03:00
6938df0d62 Use default member initializers in WORKER_STATISTICS
Makes the class simpler and removes the need for an explicit
constructor. Also switched to std::array to enable easy iteration over the
array.
2018-09-10 14:15:10 +03:00
94a567f4ca Remove redundant Worker method
The Worker::get_local_statistics was a duplicate of Worker::statistics.
2018-09-10 14:14:21 +03:00
1e7d088aed Make combination of rworker_local values easier
The `values` helper method provides a convenient way to access all of the
internal values as a vector.
2018-09-10 14:14:21 +03:00
58c0b4f5f4 MXS-1632: Remove the unused statistics code
The statistics code was almost completely unused.
2018-09-10 14:14:20 +03:00
108638b0cf Format with Uncrustify 0.67 2018-09-10 13:31:39 +03:00
d11c78ad80 Format all sources with Uncrustify
Formatted all sources and manually tuned some files to make the code look
neater.
2018-09-10 13:22:49 +03:00
edd5ddcc88 Merge branch '2.2' into develop 2018-09-10 12:29:00 +03:00
03017c6aad Fix develop build failures
The macro in testrules.cc needed to be chagned to use string literals to
work correctly with uncrustify. Also change <cmath> to <math.h> in C
headers.
2018-09-10 11:34:09 +03:00
d16fbd4cdf Expand list users output in maxctrl
The output now lists the type and privileges of each user.
2018-09-10 11:21:06 +03:00
8c03b626c4 Make users diagnostic deterministic
The output from Users::diagnostic is now ordered by first inserting the
usernames into a std::set.
2018-09-10 11:21:06 +03:00
c81173e320 Move C++ code out of C headers
The additions into the server.h header used C++ language which caused C
programs to fail to compile. Moved the implementation of the EMAverage
class into the private Server class in the server.hh header and exposed it
via functions in the server.h header. Also temporarily moved
almost_equal_server_scores into the public server.hh as there is no
service.hh header.
2018-09-10 11:21:06 +03:00
4f6990f90d Fix build failures
Changes to the ChangeMasterOptions made it non-trivial so it cannot be
safely memset anymore. The maxavrocheck was missing the linkage to the
maxscale-common library.
2018-09-10 11:05:43 +03:00
6279ab350c Rename TestConnections::assert() to TestConnections::expect()
Allows the including of <assert.h>.
2018-09-10 10:24:46 +03:00
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
fa7ec95069 MXS-1777 Tune code for cases with slow, or new servers.
Changes that allow slow or new servers to quickly apply samples towards the
server average. The most important changes are to not ignore the first N samples,
and apply an average to the server as soon as there is one available.
The new ResponseStat::make_valid() will use filter samples to add an average,
if no averages have yet been added, even if the number of  filter samples is less
than the filter limit.
2018-09-09 14:17:40 +03:00
0e5d827f7a Merge branch '2.2' into develop 2018-09-08 18:58:57 +03:00
91acbc0994 MXS-1777 Turn server weights to their inverses, and make them doubles.
The math becomes simpler when the weight is inverted, i.e. a simple multiplication
to get the (inverse) score. Inverse weights are normalized to the range [0..1] where a lower
number is a higher weight,
The enum select_criteria_t is used to provide a std::function that takes the backends
as vector  (rather than the prior pairwise compares) and returns the best backend.
2018-09-05 17:45:28 +03:00
105bd7195f MXS-1777 remove dead code
Dead code.
2018-09-05 17:12:54 +03:00
de6ad542c4 MXS-1777 Refactor selection.
This commit refactors slave selection. The compare is still pair-wise but isolated into a small run_comparison() function. The function get_slave_candidate() is used when new connections are created, which I both moved and modified (had to move due to scoping), so diff is off.
The slave selection for routing:  get_slave_backend() now has the filtering logic from old get_slave_backend() and compare_backends(), the latter of which is removed.

Backend functions mostly take shared_ptr<SRWBackend> in various forms (as is, const ref, in a container). Ideally the shared_ptr would be used only to where it is really needed, and either naked ptrs or references to RWBackend would be used. This refactor does not address that issue, but compounds it by using even deeper shared_ptr structures. Fixing that in a future commit.
2018-09-05 17:12:54 +03:00
d52885d68d MXS-1777 Cosmetic changes based on code reviews. 2018-09-05 17:05:06 +03:00
6351ab9c73 MXS-1777: Initial version of routing based on query response time.
The main piece of code, slave selection (backend_cmp_response_time), uses the available
method of pair-wise comparison of slaves. This will be changed to selection using all
available slaves, along with removal of hard coded values.
2018-09-05 17:05:06 +03:00
1e6509423a MXS-1777: Add an EMAverage to the server struct, and a new slave selection criteria.
This is to support calculating the average from a session, and the slave selection criteria to be able to route based on averages. This commit, like the next one, have TODOs which you should feel free to comment on. Undecided things.
2018-09-05 17:05:06 +03:00
cdea8aa7be mxs-1777: maxutils additions
Adding classes for calculating averages. Update StopWatch to C++11.
2018-09-05 17:05:06 +03:00