196 Commits

Author SHA1 Message Date
Esa Korhonen
1c647f3753 MXS-2220 Move most remaining functions inside class
Most of the ones still remaining outside are special cases.
Also, removed locking from status manipulation functions as it
has not been required for quite some time.
2019-01-08 15:15:34 +02:00
Esa Korhonen
d5c78eb31f MXS-2220 Move more server functions inside class 2019-01-08 15:12:47 +02:00
Esa Korhonen
8b53e30678 MXS-2220 Move server status functions inside class 2019-01-08 15:12:47 +02:00
Esa Korhonen
93aff0640c MXS-2220 Cleanup server header
Moved items around in preparation for more changes.
2019-01-07 16:10:15 +02:00
Esa Korhonen
b16ee3a94e MXS-2220 Move server_is_active inside the class 2019-01-07 16:10:15 +02:00
Esa Korhonen
764d9a4e75 MXS-2220 Move monitor user and password fields to internal class
Also changed the lengths of the buffers.
2019-01-07 16:10:15 +02:00
Esa Korhonen
ca9c52944b MXS-2220 Use std::string for protocol and authenticator fields 2019-01-03 12:13:15 +02:00
Esa Korhonen
40485d746c MXS-2220 Change server name to constant string 2019-01-03 12:13:15 +02:00
Esa Korhonen
5fc2c1f49c MXS-2220 Store server ports as integers and modify them in methods 2019-01-03 12:13:15 +02:00
Esa Korhonen
09aa54720d MXS-2220 Read server version using public methods
Version related fields have been removed from the public class.
2019-01-03 11:23:14 +02:00
Esa Korhonen
d1b098d3b0 MXS-2200 Store server version string and type in internal class 2019-01-02 12:53:52 +02:00
Markus Mäkelä
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
Esa Korhonen
eacf88f6a5 MXS-2220 Add server version and type information struct
The old fields are still used.
2018-12-19 13:18:16 +02:00
Esa Korhonen
c8fc956b7b MXS-2220 Combine anonymous namespaces
Also clean up file local variables.
2018-12-18 12:34:51 +02:00
Esa Korhonen
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
Esa Korhonen
31ceee6d22 MXS-2220 Move persistent DCB settings and handling to the private Server-class 2018-12-18 12:14:44 +02:00
Esa Korhonen
6209d737e9 MXS-2220 server_alloc returns internal type
Also adds default initializers to SERVER fields.
2018-12-14 10:31:57 +02:00
Esa Korhonen
3f81a37e70 MXS-2220 Move rest of dcb printing functions to private class 2018-12-14 10:18:14 +02:00
Esa Korhonen
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
Esa Korhonen
63e334d6c0 MXS-2220 mxs::server_status() accepts status flags
The overload is required to get rid of dummy SERVER objects.
2018-12-13 10:20:06 +02:00
Esa Korhonen
84e8efceca MXS-2220 Use private server class in runtime alter commands
This only affects commands started from MaxAdmin.
2018-12-12 16:06:08 +02:00
Esa Korhonen
86574c16fb Return std::string in server_status() 2018-12-10 15:55:07 +02:00
Johan Wikman
c0c9a9858d MXS-2197 Rename maxscale/log.h to maxscale/log.hh
In files either include maxscale/log.hh or remove include entirelly
as maxscale/ccdefs.hh includes it.
2018-12-10 12:58:17 +02:00
Johan Wikman
1b5b789342 MXS-2208 Move trim-functions from maxscale to maxbase
log.h now includes string.hh, which is conceptually wrong, but
log.h will shortly disappear and be superceded by log.hh.
2018-12-10 12:50:07 +02:00
Markus Mäkelä
7ca421fe5f
MXS-2196: Fix persistent connections
The connections now use the correct parameter.
2018-12-05 15:30:44 +02:00
Esa Korhonen
d96a7dedc5 MXS-2205 Convert maxscale/poll.h to .hh 2018-12-04 14:51:02 +02:00
Markus Mäkelä
43c33e9f4a
MXS-2196: Allocate a session before allocating DCBs
Allocating the session before a DCB guarantees that at no point will a DCB
have a null session. This further clarifies the concept of the session and
also allows the listener reference to be moved there.

Ideally, the session itself would allocate and assign the client DCB but
since the Listener is the only one who does it, it's acceptable for now.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
7a87ff9ce1
MXS-2196: Remove redundant DCB member variables
The variables held duplicate information already present in other parts of
the system.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
ad12ff6d06
MXS-2196: Rename dcb.h to dcb.hh 2018-12-04 11:50:43 +02:00
Markus Mäkelä
3b5e45ceee
MXS-2196: Combine session.h and session.hh
Combined the public session headers into one.
2018-12-04 11:43:38 +02:00
Esa Korhonen
36792607d8 MXS-2205 Combine internal/modules.h with internal/modules.hh 2018-12-03 13:36:25 +02:00
Esa Korhonen
344c7dde4a MXS-2205 Combine internal monitor headers
Contents of monitor.h moved to monitor.hh
2018-12-03 13:32:09 +02:00
Markus Mäkelä
77585bdb8c
MXS-2197: Make config.h and service.h C++ headers
This is the first step into converting the other headers into C++.
2018-11-30 12:15:57 +02:00
Esa Korhonen
01628dd0de Cleanup server version updating 2018-11-21 17:36:52 +02:00
Markus Mäkelä
cbe1483028
MXS-2167: Add support for extra_port
This allows MaxScale to connect to the server even when max_connections
has been reached.
2018-11-15 14:24:41 +02:00
Niclas Antti
f8c132903b Fix query average measurment and average text output.
The query_ended() call was not in the right spot. Tests did not
detect it. Changed textual output to reflect the fact that they
are for RWSplit reads.
2018-11-04 17:18:09 +02:00
Esa Korhonen
e0c46a9c9a Initialize server version string
Could read uninitialized data.
2018-10-16 16:09:38 +03:00
Niclas Antti
9c52ba5c07 Update release notes and documentation for the Throttle Filter
and Adaptive Routing
2018-10-05 13:52:42 +03:00
Markus Mäkelä
75ea1b6ea1
Fix formatting of new(std::nothrow)
The code previously formatted everything as `new( std::nothrow)`.
2018-10-04 21:50:44 +03:00
Niclas Antti
e56492c23f MXS-1777 Make "Sample Max" of the server EMAverage adaptive
A rather simple but very effective method as testing shows.
2018-10-04 17:53:57 +03:00
Niclas Antti
19f8e1697b Make the Server's EMAverage a member
The combined effort of all workers of updating EMAverage is needed for precision,
statistics and making parts of it adaptive (rather than hardcoded or configured).
2018-10-04 17:53:57 +03:00
Markus Mäkelä
c95adf1f2e
Add prefix to Server member variables
Added the m_ prefix to Server member variables.
2018-09-28 12:18:24 +03:00
Markus Mäkelä
3ee5d9a8ea
MXS-2067: Move server lock into Server class
The lock for the server is now only visible to the MaxScale core. Changing
the type to std::mutex also allows the use of RAII lock guards.
2018-09-28 12:18:23 +03:00
Markus Mäkelä
fc1e36429c
MXS-2067: Replace SPINLOCK with pthread_mutex_t
Replaced the SPINLOCK implementation with pthread_mutex_t. The SPINLOCK
interface is still used and will be removed later on.
2018-09-28 12:18:23 +03:00
Markus Mäkelä
71ffef5708
Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
Markus Mäkelä
2e069fa892
MXS-1632: Take mxb::atomic::add into use
The function now mostly replaces the use of atomic_add_ functions declared
in atomic.h.
2018-09-18 15:21:54 +03:00
Markus Mäkelä
62788f39e1
Make response time statistics worker-local
Given that the response times across threads are extremely likely to be
nearly identical, the data can be partitioned by worker thread.
2018-09-18 15:21:53 +03:00
Markus Mäkelä
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
Markus Mäkelä
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
Niclas Antti
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