11218 Commits

Author SHA1 Message Date
Markus Mäkelä
4d3dbb2040
MXS-1929: Take SFilterDef into use
The service now uses a std::vector<SFilterDef> to store the filters it
uses. Most internal parts deal with the SFilterDef but debugcmd.cc still
moves raw pointers around (needs to be changed).
2018-08-06 21:20:29 +03:00
Markus Mäkelä
00ab890b19
MXS-1929: Store filters in smart pointers
The FilterDef structs are now stored in a vector<std::shared_ptr>. This
should make it easier to use filters even if they are deleted before the
session using them closes.

All internal functions now take a smart point as a parameter. One
problematic case will be debugcmd.cc which moves information around as
pointers cast into unsigned longs.
2018-08-06 21:20:29 +03:00
Markus Mäkelä
d793fcbcb0
Remove element from CONFIG_CONTEXT
The variable was set but never used.
2018-08-06 21:20:29 +03:00
Markus Mäkelä
a252b45f18
Don't use auto&& in non-template code
Use explicit types instead.
2018-08-06 21:20:29 +03:00
Markus Mäkelä
4c7a5017bc
MXS-1929: Create internal server representation
The server now has an internal C++ version that extends the public one.
2018-08-06 21:20:29 +03:00
Markus Mäkelä
ea8b522c8a
MXS-1929: Combine service creation and configuration
The servers and filters are taken into use immediately after the service
is created. This removes the need for a second configuration step.
2018-08-06 21:20:29 +03:00
Markus Mäkelä
c01840ffb3
Remove unnecessary SConfig from readwritesplit
The configuration doesn't need to be contained in shared pointer as each
session holds its own version of it. This removes most of the overhead in
configuration reloading. The only thing that's left is any overhead added
by the use of thread-local storage.
2018-08-06 21:20:29 +03:00
Markus Mäkelä
403b9e09f5
Remove old LICENSE file
The tests had it from the time before they were merged into MaxScale.
2018-08-06 21:19:49 +03:00
Markus Mäkelä
7425d80436
Increase query_retries for mxs1507_migrate_trx
The switchover sometimes fails due to a broken connection when the STOP
SLAVE on the new master is executed. Nothing is logged on the server in
question and the error message simply states that the connection was lost
in the middle of a query.

Increasing the query_retries to 1 reduced the likelihood of failure from
about 1/3 of tests failing to roughly 1/6 of tests failing. Increasing it
to 5 seems to remove it completely. As to what is the real reason this
happens, we do not yet know.
2018-08-06 21:19:48 +03:00
Markus Mäkelä
376cd3aa9e
Enable query_retries by default
Enabling it with a value of 1 should remove the vast majority of
connection related problems that appear in MaxScale. This should filter
out most of the errors caused by transient network problems.
2018-08-06 21:19:48 +03:00
Markus Mäkelä
0795d60007
Use MASTER_GTID_WAIT in binlog tests
This should help with the slave synchronization problem.
2018-08-06 21:19:48 +03:00
Esa Korhonen
0a81f78442 Use unique pointer instead of auto-pointer 2018-08-06 13:24:05 +03:00
Esa Korhonen
c0bd5ca3a1 MXS-1905 Switchover if master is low on disk space
Required quite a bit of refactoring.
2018-08-06 13:24:05 +03:00
Johan Wikman
84b3e4672f Merge branch '2.2' into develop 2018-08-06 13:08:55 +03:00
Johan Wikman
ec178fd8da MXS-1983 Add missing semicolon 2018-08-06 12:59:13 +03:00
Johan Wikman
6945e82b3f Merge branch '2.2' into develop 2018-08-06 12:31:58 +03:00
Johan Wikman
05129540b4 Update change log and release notes 2018-08-06 12:10:12 +03:00
Markus Mäkelä
5b04e492c6
MXS-1983: Retry message posting
If the posting of a message to a message queue fails due to the queue
being full, it is retried for a limited number of times. This is a
temporary fix to the problem that fixing MXS-1948 introduced. A proper
solution that leverages SO_REUSEPORT should be implemented in the next
major release.
2018-08-03 23:29:25 +03:00
Markus Mäkelä
6fc3fbd697
Fix debug assertion when a DCB is printed
All DCBs don't have the server pointer set so it needs to be checked
before calling any functions that take a server as a parameter.
2018-08-03 10:34:50 +03:00
Markus Mäkelä
d22b02047f
Disable parameters on main worker
Disabling the parameter on the main worker prevents deadlocks if the
parameter is disabled at the same time a monitor diagnostic is executed.
2018-08-03 10:34:47 +03:00
Johan Wikman
0d934476b0 MXS-1992 Provide std::default_delete<json_t> 2018-08-03 07:33:12 +03:00
Johan Wikman
166ecfead6 MXS-1992 MaxAdmin uses RoutingWorker for QC stats 2018-08-03 07:33:12 +03:00
Johan Wikman
b76cdc944b MXS-1992 RoutingWorker provides access to QC stats
This will be used in the context of MaxAdmin and MaxCtrl.
2018-08-03 07:33:12 +03:00
Johan Wikman
c302268ca3 MXS-1992 Provide maxadmin if for getting qc stats
- Equivalent functionality will be provided for maxctrl.
- Functionality for obtaining the data will be moved to RoutingWorker.
2018-08-03 07:33:12 +03:00
Johan Wikman
ae27ea92a0 MXS-1992 Thread-initialize internal QC module 2018-08-03 07:33:12 +03:00
Johan Wikman
25536af91f MXW-1992 Update size when inserting 2018-08-03 07:33:12 +03:00
Markus Mäkelä
1f5e23c674
MXS-1997: Increase object name length limits
Updated the limits to 1023 characters and documented the old value.
2018-08-02 22:12:06 +03:00
Markus Mäkelä
46ed043fb0
Display diagnostics for running monitors
If a monitor is not running, the diagnostics function will not be called.
2018-08-02 18:56:36 +03:00
Markus Mäkelä
be6a404c0b
Fix crash on failure to create service
The service would not be in the list if it failed before it was placed
there. Moving the actual freeing of memory into the Service destructor
allows it to be called directly when we know the service is not in the
list. This also only allows valid services to be placed into the global
list of services.

To prevent freeing a partially constructed service, the memory allocation
checks were replaced with a runtime assertion. This can be changed when
the creation of the service is done only at a point where we know it can't
fail. Currently, the createInstance call expects the service as a
parameter which prevents this.
2018-08-02 18:56:36 +03:00
Markus Mäkelä
d412b8d729
Move execute_worker_task into mxs::Worker
The function has use outside of the monitors as it makes execution of
worker tasks much more convenient. Currently, this change only moves the
code and takes it into use: there should be no functional changes.
2018-08-02 18:56:35 +03:00
Markus Mäkelä
107395f608
Fix debug assertion on MaxScale shutdown
The assertion didn't take into notice whether teardown had started.
2018-08-02 18:56:35 +03:00
Markus Mäkelä
8cd07def80
Add timeout to mxs1929_service_runtime
Some of the commands appear to be hanging.
2018-08-02 18:56:35 +03:00
Markus Mäkelä
b14cfea7e3
Fix alloc-dealloc mismatch
The filter was deleted using free but allocated with new.
2018-08-02 18:56:34 +03:00
Markus Mäkelä
8b9f7cc458
Fix alter_router configuration
The stale slave detection is needed.
2018-08-02 18:56:22 +03:00
Johan Wikman
a5e7c08973 MXS-1992 Pre-increment provides a slight benefit 2018-08-02 14:16:53 +03:00
Johan Wikman
e637acd0a2 MXS-1992 Canonicalize using std::string
Significantly reducing the number of allocations done.
2018-08-02 14:16:53 +03:00
Johan Wikman
bcdab394c1 MXS-1992 Provide canonical function for std::string 2018-08-02 14:16:53 +03:00
Johan Wikman
81297fb919 Update naming convention for structs
The earlier guideline was just a "formalization" of existing
conventions.
2018-08-02 14:16:53 +03:00
Esa Korhonen
836db54800 Clean up server status printing
Uses mostly the status functions for reading the flags. Strickly
speaking this breaks the REST API since in some cases (status combinations)
the printed string is different from what was printed before.
2018-08-02 10:42:12 +03:00
Johan Wikman
f7e3d4c2fb Remove maxscale/thread.hh
A C++11-like implementation of thread, future, etc. that now is
obsolete as we use C++11.
2018-08-01 17:12:49 +03:00
Markus Mäkelä
9e084753b0
Reduce test verbosity on failure
The tests should stop attempting any queries after the first failure.
2018-08-01 16:48:05 +03:00
Markus Mäkelä
359f61c73b
Improve shutdown signal safeness
The signal handler no longer acquires the service list lock which removes
a number of deadlock possibilities from the shutdown process. Instead, a
global shutdown flag is set that serves the same purpose as the individual
service shutdown flags did.
2018-08-01 16:48:05 +03:00
Markus Mäkelä
8a248dd930
Copy callbacks by value in mxs_rworker_broadcast
Copying by reference will not work as the references will refer to the
values passed to the function, not the actual callbacks.
2018-08-01 16:48:04 +03:00
Markus Mäkelä
2939779052
Merge branch '2.2' into develop 2018-08-01 16:47:19 +03:00
Markus Mäkelä
47c89d5b89
Remove duplicate variable
Caused by rebasing changes. Also fixed the comment to reflect the current
situation.
2018-08-01 15:06:39 +03:00
Markus Mäkelä
a0b0f7993e
Create servers in configuration order
As we know servers don't have dependencies, we can construct them in
configuration file order.
2018-08-01 15:02:02 +03:00
Marko
f68da38b32 Clean up get_shard_target in schemarouter
get_shard_target had become little bloated with the recent changes so
some routing cases were moved to their own functions. Also removed
some code that was not needed.
2018-08-01 11:55:31 +03:00
Johan Wikman
ef7fa7f879 MXS-1992 Implement cache size control
The cache now enforces the defined maximum size by evicting some
entries in case the insertion of a new entry would cause the max
size to be exceeded. Currently the eviction algorithm simply
removes a random element.
2018-08-01 11:10:34 +03:00
Johan Wikman
466e8a923c MXS-1992 Handle 'query_classifier_cache_size' parameter
No effect yet on the caching.
2018-08-01 11:10:34 +03:00
Johan Wikman
6d5210b4cb MXS-1992 Add qc cache documentation 2018-08-01 11:10:34 +03:00