Commit Graph

12586 Commits

Author SHA1 Message Date
9adbd2f8f0 Cache the local server statistics object
By storing the server statistics object in side the session, the lookup
involved in getting a worker-local value is avoided. Since the lookup is
done multiple times for a single query, it is beneficial to store it in
the session.

As the worker-local value is never deleted, it is safe to store a
reference to it in the session. It is also never updated concurrently so
no atomic operations are necessary.
2019-01-03 09:37:59 +02:00
1fa3b133c7 Make keepalive ping checks more efficient
The code now only checks the need for a keepalive ping once every
keepalive interval. Reduced the number of mxs_clock calls to one so that
all servers use the same value.
2019-01-03 09:37:59 +02:00
5420bf618d Allow systemd notifications from all member processes
By default the notifications are only allowed from the main process or any
child process that systemd finds. When the main process has not yet been
detected by systemd but MaxScale sends a notification, an error is logged
into the system journal. To prevent this, notifications from all member
processes should be allowed.
2019-01-03 09:37:59 +02:00
050ce7f1a3 MXS-2200: Add runtime handling for all global parameters
All global parameters are now handled by the runtime configuration
modification code. The parameters that are trivial to update can now be
updated at runtime. All other global parameters cause a new error message
to be returned stating that the parameter in question cannot be modified
at runtime.

Also updated the list of modifiable parameters in MaxCtrl. This list
should not be stored in MaxCtrl and should be created by MaxScale at
runtime.
2019-01-03 09:37:59 +02:00
88f234fdcd MXS-2214: Fix object names in documentation
The object names now always use a valid and supported form.
2019-01-03 09:37:59 +02:00
ee98900685 MXS-2200: Extend REST API tests
Added test cases for static and unknown global parameters.
2019-01-03 09:37:59 +02:00
26da72a41f Merge branch '2.2' into 2.3 2019-01-03 09:23:16 +02:00
8f0e4a3034 MXS-2232: Fix version string prefix check
The prefix was always added even when the original version would've been
acceptable. For example, a version string of 5.5.40 would get converted to
5.5.5-5.5.40 which is quite confusing for older client applications.
2019-01-02 19:29:48 +02:00
04dd05b262 MXS-2231: Move TLS handshake code into MariaDBClient
The code is now in the correct place and TLS connections with all
authenticators should now work.
2019-01-02 19:29:41 +02:00
d48c17fd08 MXS-2231: Add Kerberos+SSL test case
Added a test case that uses Kerberos services with SSL enabled listeners.
2019-01-02 19:27:14 +02:00
edd03e950f MXS-2209: Use compound roles only with 10.2.15+
Due to MDEV-15556 and MDEV-15840 recursive CTEs can't be reliably used
with older 10.2 versions. To prevent problems, only use the query that
extracts composite roles with newer versions.
2019-01-02 19:27:14 +02:00
d1b098d3b0 MXS-2200 Store server version string and type in internal class 2019-01-02 12:53:52 +02:00
038f4d63e1 Mxs 2226 long test (#186)
* add possibility to run named test

* remove sysbench_dir

* remove unsupported in 1.0 sysbench options

* exculed ReadConnRouter sysbench test

* fix sysbench table name
2018-12-31 17:27:04 +02:00
54ae7119cf Fix binlogrouter master reconnection
The reconnection attempt to the master won't work if users aren't loaded
before it.
2018-12-31 10:39:57 +02:00
630165e52b Fix closing of pooled DCBs
DCBs can now have a null session pointer and if they do, they are in the
persistent pool. The no-null-session assertions are no longer valid but
with a reorganization of the pooling code to only use file descriptors,
the assertions can be added back.
2018-12-29 19:16:34 +02:00
4ab25bcd1c Fix schemarouter duplicate database detection
The detection wouldn't work if the database had no tables.
2018-12-28 11:33:43 +02:00
3b150ad4b2 Fix binlogrouter use of DCBs
The dcb_connect function requires that the client DCB has a remote
address.
2018-12-28 10:13:24 +02:00
4d0a40ef9f Add missing pointer initialization
The change from SRWBackend to RWBackend* had some side effects, namely the
missing automatic initialization into zero values.
2018-12-28 08:19:23 +02:00
459eb003de MXS-2196: Don't start if listeners fail to start
The old behavior is to not start MaxScale if any listeners fail to
bind. This behavior is convenient when there are conflicts with other
applications so it should remain. This change prevents the internal
service restarts from functioning which might have already been broken.

The "restarting" of services after a failure to bind to an interface is
somewhat questionable. Almost no transient errors are expected at startup
with the exception of running out of sockets. This should probably be the
only case when the internal service restart is done and in other cases it
causes more harm than good.
2018-12-27 15:12:52 +02:00
6206abde3e Update Server version in server_set_version
The new method was not called by the old function.
2018-12-27 14:44:13 +02:00
1fa0144b0b Fix broken http test 2018-12-20 09:32:51 +02:00
eacf88f6a5 MXS-2220 Add server version and type information struct
The old fields are still used.
2018-12-19 13:18:16 +02:00
115feab946 MXS-2164 Add skeleton Clustrix monitor 2018-12-18 15:17:09 +02:00
910777efbc MXS-2208 Address review comments
Also report errors in more detailed manner.
2018-12-18 15:16:45 +02:00
3eca3ff7dc MXS-2208 Add init/finish functions for mxb::http
Init/finish needed, as curl otherwise will leak memory.
2018-12-18 15:16:45 +02:00
0d733bb1bb MXS-2208 Implement synchronous GET in terms of asynch 2018-12-18 15:16:45 +02:00
847f53b21b MXS-2208 Introduce asynchronous GET
A multi HTTP GET can now be performed so that the caller
drives the polling of results.

This can now be used so that inside a monitor worker, the delays
are handled using delayed calls. Consequently, the monitor worker
event loop can remain responsive even though the Clustrix nodes
are being polled.
2018-12-18 15:16:45 +02:00
38a0d6a2df MXS-2208 If no sockets, then we use timeout
If no sockets, then we use timeout; not the other way around.
2018-12-18 15:16:45 +02:00
1d338f3c4a MXS-2208 Add synchronous multi GET
Now possible to GET multiple URLs in one go. Behind the scenes
the getting is done asynchronously and in parallell.
2018-12-18 15:16:45 +02:00
da3742324a MXS-2208 Now use trim() from maxbase 2018-12-18 15:16:45 +02:00
c8fc956b7b MXS-2220 Combine anonymous namespaces
Also clean up file local variables.
2018-12-18 12:34:51 +02:00
569c66fa28 MXS-2220 Store server parameters in stl containers
The custom parameters are now protected from concurrent access.
2018-12-18 12:34:06 +02:00
383f5304d9 MXS-2220 Use private Server class in config_runtime
Required for further changes.
2018-12-18 12:15:17 +02:00
31ceee6d22 MXS-2220 Move persistent DCB settings and handling to the private Server-class 2018-12-18 12:14:44 +02:00
5a9e84d39a Merge branch '2.3' into develop 2018-12-18 00:00:00 +02:00
35d31801bb Merge branch '2.2' into 2.3 2018-12-17 23:52:56 +02:00
208a1d011e Pre-allocate return value in get_canonical
Since we know the worst-case size of a canonical statement is the size of
the query string, we can reduce the number of memory allocations to one in
the get_canonical function.
2018-12-17 23:16:01 +02:00
e386dcba88 Merge branch '2.3.2' into 2.3 2018-12-17 09:33:40 +02:00
8b6022ee6d Fix link in 2.3.1 release notes 2018-12-17 09:33:22 +02:00
8725205873 Update version in license text 2018-12-17 09:33:22 +02:00
e2c52ecd19 Update version in license text 2018-12-17 09:14:36 +02:00
405b4de1dd MXS-2220 Move MxsDiskSpaceThreshold definition to SERVER
Reduces include-clutter a bit.
2018-12-14 10:32:25 +02:00
6209d737e9 MXS-2220 server_alloc returns internal type
Also adds default initializers to SERVER fields.
2018-12-14 10:31:57 +02:00
3f81a37e70 MXS-2220 Move rest of dcb printing functions to private class 2018-12-14 10:18:14 +02:00
2b0eac2cd0 Move server disk space threshold setting to private Server-class
The setting can be read and written simultaneously and is protected with
a mutex.

The public SERVER-class is now abstract.
2018-12-14 10:18:14 +02:00
7cf73e0f13 MXS-2196: Fix use of DCBs in binlogrouter
The binlogrouter now handles the DCB creation a bit more correctly but it
still breaks a few of the rules.
2018-12-13 13:27:45 +02:00
a40e2f94f3 Fix file descriptor assertions
Zero is a valid file descriptor and no negative values other than -1 are
ever stored in the DCB::fd member.
2018-12-13 13:27:45 +02:00
ae62cf6eb6 MXS-2196: Fix DCB session check
The check was missing the special case of persistent connections.
2018-12-13 13:27:45 +02:00
20fe9b9dca MXS-2196: Rename session states
Minor renaming of the session state enum values. Also exposed the session
state stringification function in the public header and removed the
stringification macro.
2018-12-13 13:27:45 +02:00
7aaadfc550 MXS-2196: Fix dcb error flag assignment
The error flag was set before the function was called which caused the
function to never be used. As the core should handle the filtering of
multiple errors on the same DCB, the protocol modules should not check it.
2018-12-13 13:27:45 +02:00