12743 Commits

Author SHA1 Message Date
Esa Korhonen
cc06f98e42 MXS-2050 Move diagnostics and command handlers inside class 2019-02-11 14:17:43 +02:00
Markus Mäkelä
661f1dd4e4
Merge branch '2.3' into develop 2019-02-11 13:14:52 +02:00
Johan Wikman
7a99b5d253 MXS-2314 Define monitor state in terms of worker state
Worker::STOPPED    -> MONITOR_STATE_STOPPED
Worker::POLLING    -> MONITOR_STATE_RUNNING
Worker::PROCESSING -> MONITOR_STATE_RUNNING

By defining the monitor state from the worker state there is
no risk they will ever get out of sync. And there is one thing
less to maintain.
2019-02-11 13:03:18 +02:00
Johan Wikman
544e88a0b8 MXS-2314 Remove unnecessary monitor state 2019-02-11 13:03:18 +02:00
Johan Wikman
72d02d33c0 MXS-2314 Remove unnecessary worker states
The removed states were not used for anything useful.
2019-02-11 13:03:18 +02:00
Johan Wikman
6425d4ed0c MXS-2314 Ensure that connections are closed
As m_servers is a member of Monitor, it is better if the closing
of the MYSQL connections is done there, so that derived classes
do not need to remember doing that.
2019-02-11 13:03:18 +02:00
Johan Wikman
dffb933efa MXS-2314 Do not accept NULL when starting/stopping monitor 2019-02-11 13:03:18 +02:00
Johan Wikman
3646c118c9 MXS-2314 Move journal checking inside Monitor 2019-02-11 13:03:18 +02:00
Johan Wikman
cac1d76e48 MXS-2314 Monitor decides whether servers are added to services
When the servers of a service are defined by a monitor, then
at startup all servers of the monitor should be added to relevant
services. Likewise, when a server is added to or removed from a
monitor at runtime, those changes should affect services as well.

However, whether that should happen or not depends upon the monitor.
In the case of the Clustrix monitor this should not happen as it
adds and removes servers depending on the runtime state of the
Clustrix cluster.
2019-02-11 13:03:18 +02:00
Johan Wikman
ab93216064 MXS-2314 Server added to monitor should be added to service
If the servers of a service are defined by a monitor (the config
has 'cluster=SomeMonitor'), then the addition of a server to a
a monitor should lead to that server being added to the service.
2019-02-11 13:03:18 +02:00
Johan Wikman
0e3ec06c5b MXS-2314 Prevent removal of servers from clustered services
If the servers of a service are defined by a monitor, then it must
not be possible to dynamically add or remove servers from the
service.
2019-02-11 13:03:18 +02:00
Johan Wikman
b4eb87dfcc MXS-2314 Populate services with servers
The services whose servers are defined using a monitor, will
now be populated from the monitor.

Note, no consideration has yet been given to runtime changes.
2019-02-11 13:03:18 +02:00
Johan Wikman
f271c5cea1 MXS-2314 Add 'cluster' parameter to service
Using the cluster parameter, the servers of a service can be
defined using a monitor.

This change basically only introduces the parameter.
2019-02-11 13:03:18 +02:00
Markus Mäkelä
1073bc1832
Remove false assertion
The list can be empty
2019-02-11 12:40:43 +02:00
Markus Mäkelä
38069bb32d
MXS-1757: Never link avro against snappy
The Avro libraries appear to sometimes overwrite the CMake
variables. Patching out the code that looks for the libraries should
prevent the library from ever being linked against the snappy libraries.
2019-02-11 10:59:53 +02:00
Markus Mäkelä
aea64aede2
Prune only when history size is exceeded
The documentation stated that at most `max_sescmd_history` commands were
kept but in reality the number of commands kept in the history was one
command smaller than what was documented.
2019-02-11 10:58:17 +02:00
Markus Mäkelä
b93d35ab03
Revert "MXS-2300: Fix off-by-one bug in history size"
This reverts commit 840b4b24bd048ed536621d4433abbb4e846dfcc5.
2019-02-11 10:58:17 +02:00
Johan Wikman
a65bf3e766 Update 2.3.4 release notes 2019-02-11 10:15:09 +02:00
Markus Mäkelä
d04fc6c4b9
Merge branch '2.2' into 2.3 2019-02-08 16:14:58 +02:00
Markus Mäkelä
3c5dd257fd
MXS-2311: Test MXS-2311 in mxs827_write_timeout
By repeatedly doing reads instead of one read per second, it is more
likely that MXS-2311 is reproduced. This is still not a deterministic
process but in theory it can reproduce the problem.
2019-02-08 15:03:06 +02:00
Markus Mäkelä
46484b4e11
MXS-2311: Write queued packet one at a time
If an ignorable packet was followed by more than one queued packets, they
would all get routed in the same batch. This would cause unexpected
replies from the server if multiple ignorable packets were queued up.
2019-02-08 14:18:41 +02:00
Esa Korhonen
19ab89144b MXS-2050 Move filter settings to a container 2019-02-08 13:49:11 +02:00
Esa Korhonen
c09128111c MXS-2050 Move more static functions to class methods 2019-02-08 13:49:11 +02:00
Esa Korhonen
81f1cf567e MXS-2050 Rearrange methods
Several functions moved to class methods.
2019-02-08 13:47:45 +02:00
Esa Korhonen
7bbd155a7a MXS-2050 Clean up qlafilter code
Move class and related declarations to a header file, run uncrustify.
2019-02-08 13:47:45 +02:00
Johan Wikman
8c5c93eb60 Remove superfluous const casts 2019-02-08 12:27:45 +02:00
Johan Wikman
3550048c19 Fix mock-framework
Got broken due to changes in how configuration settings are handled.
2019-02-08 12:12:31 +02:00
Johan Wikman
2e270ce1ac Merge branch '2.3' into develop 2019-02-08 10:39:33 +02:00
Johan Wikman
c0593936b8 Update change log and release notes for 2.3 2019-02-08 10:38:22 +02:00
Markus Mäkelä
946ffbb40d
Merge branch '2.2' into 2.3 2019-02-08 10:23:47 +02:00
Markus Mäkelä
1be845c438
MXS-2322: Fix maxctrl authentication
The username and password are now explicitly passed to request instead of
being added into the URI manually.
2019-02-08 10:01:48 +02:00
Esa Korhonen
35ab911d5c MXS-2304 Use configuration class methods instead of separate implementations
Replaces parameter add/set/remove/free.
2019-02-07 13:51:16 +02:00
Esa Korhonen
ed80680da9 MXS-2304 Add ctor/dtor and other functions to parameter class
The manipulation functions are currently static so that the container can be initialized
if required. This will be fixed later.

The new functions are taken into use in monitor management.
2019-02-07 13:51:16 +02:00
Markus Mäkelä
42b5c39f43
Merge branch '2.3' into develop 2019-02-07 10:50:27 +02:00
Markus Mäkelä
b560a67e54
Merge branch '2.2' into 2.3 2019-02-07 10:45:57 +02:00
Markus Mäkelä
994bfcd285
MXS-2268: Fix undefined behavior
Using a void return value as an integer results in undefined behavior.
apparently in this case it doesn't translate into a crash and instead only
manifests itself when all the planets align.
2019-02-07 10:38:38 +02:00
Markus Mäkelä
08a05d3ab9
Fix use of uninitialized variables
Building with optimization in debug mode revealed code that could in
theory result in undefined behavior.
2019-02-06 14:22:24 +02:00
Markus Mäkelä
cc6665c732
Add solo mode to compare
In this mode the compare program does a sanity check where it compares the
output of a classifier when a statement is classified multiple times. The
main use-case for this is to get the verbose output generated when the -v3
option is added, not the sanity check itself.
2019-02-06 13:55:41 +02:00
Esa Korhonen
934be45b68 MXS-2304 Remove config_get_string() and config_get_value_string()
Some functions accessing internal pointers still remain.
2019-02-06 12:58:59 +02:00
Esa Korhonen
4b2c0b3edd MXS-2304 Cleanup server_alloc()
Avoids using config_get_string().
2019-02-06 12:36:23 +02:00
Esa Korhonen
78d9ef2910 MXS-2304 Remove remaining uses of config_get_string() from module code
The function returns a pointer to an internal string and should not be
used.
2019-02-06 12:36:23 +02:00
Esa Korhonen
5ab7734e9d MXS-2304 Add contains() to test if a parameter exists
Replaces uses of config_get_param() in modules either with contains()
or get_string(). The config_get_param() is moved to internal headers,
as it allows seeing inside a config setting.
2019-02-06 12:36:23 +02:00
Johan Wikman
8e563bd0b6 MXS-2237 Update configuration guide with 2.4 changes
- New server state: 'Being Drained'
- New monitor: clustrixmon
2019-02-06 12:27:10 +02:00
Johan Wikman
b8be905b08 Merge branch '2.3' into develop 2019-02-06 12:24:09 +02:00
Markus Mäkelä
d8b9bcfdd9
Add invalid JSON to error message
If the schema parsing fails due to an error, add the actual JSON to the
error string. This helps solve any problems that might occur due to
malformed JSON on the sending end.
2019-02-06 12:11:13 +02:00
Markus Mäkelä
cf4724d128
MXS-2265: Fix formatting of the zero timestamp
The UNIX timestamp 0 should be treated as a special value and must be
interpreted as 0-00-00 00:00:00 instead of 1970-01-01 00:00:00.
2019-02-06 12:11:06 +02:00
Markus Mäkelä
554f1cc41c
MXS-2265: Extend datatype test case
Added zero date testing.
2019-02-06 12:11:06 +02:00
Markus Mäkelä
3a40faf77d
MXS-2288: Document source parameter behavior 2019-02-06 12:11:06 +02:00
Markus Mäkelä
5e19d1d044
MXS-2315: Use BRE with std::regex
The default ECMAScript syntax appears to be broken on CentOS 7 which
effectively prevents its use in most cases. A more reliable alternative
would be to use the bundled PCRE2 library but the basic POSIX regular
expressions seem to work.
2019-02-06 12:11:06 +02:00
Johan Wikman
01bb267aa0 MXS-2237 Replace manual TOC with [TOC] 2019-02-06 11:17:02 +02:00