11209 Commits

Author SHA1 Message Date
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
Johan Wikman
f584b481eb MXS-1992 Add program for measuring cache performance
With this program it is possible to find out the difference in
performance between cached and non-cached query classification.
2018-08-01 11:10:34 +03:00
Johan Wikman
18180cd4ac MXS-1624 Also explicit parsing should utilize the cache 2018-08-01 11:10:34 +03:00
Markus Mäkelä
a6afc7fcbd
Update 2.2 version number
Updated version to 2.2.13 in preparation for the next release.
2018-07-31 22:53:11 +03:00
Markus Mäkelä
a91b054eb4
Fix out-of-source runs of mxs791_galera.sh
The test used the current directory instead of the source directory where
the script was located.
2018-07-31 22:53:10 +03:00
Markus Mäkelä
ec420332ea
MXS-1929: Take ResultSet into use
Replaced the previous RESULTSET with the new implementation. As the new
ResultSet doesn't have a JSON streaming capability, the MaxInfo JSON
interface has been removed. This should not be a big problem as the REST
API offers the same information in a more secure and structured way.
2018-07-31 22:50:08 +03:00
Markus Mäkelä
8ababa1d39
MXS-1929: Make core ResultSet functions private
The functions in the core that generate a ResultSet are now private.
2018-07-31 22:32:32 +03:00
Markus Mäkelä
bd48db28ec
MXS-1929: Simplify result set mechanism
The result set mechanism was ill-suited for iteration over
lists. Converting it into a class and inverting it by pushing rows into
the result set instead the result set asking for rows makes it very easy
to use with lists. It also solves some of the consistency problems that
existed with the previous implementation.
2018-07-31 22:32:32 +03:00
Markus Mäkelä
28e55b260f
Fix test failures
Added timeouts to maxinfo_sql and mysqlmon_failover_stress, fixed
fwf_syntax to work with out-of-source test runs.
2018-07-31 22:32:31 +03:00
Markus Mäkelä
ad5762a2fb
Fix debug assertion on shutdown
The debug assertion that asserts that services are destroyed only on the
main worker would be triggered on shutdown as there is no current worker
at that point in time. In addition to this, it is wrong to call
service_destroy at shutdown as that will remove persisted
configurations. The service_free function can be called directly as we
know no other thread are running when the services are being torn down.

Also added the missing check that the destroyInstance function is
implemented before calling it.
2018-07-31 22:32:31 +03:00