Commit Graph

175 Commits

Author SHA1 Message Date
d5c78eb31f MXS-2220 Move more server functions inside class 2019-01-08 15:12:47 +02:00
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
f0f9c21d1c Merge branch '2.3' into develop 2019-01-07 10:54:42 +02:00
ca9c52944b MXS-2220 Use std::string for protocol and authenticator fields 2019-01-03 12:13:15 +02:00
40485d746c MXS-2220 Change server name to constant string 2019-01-03 12:13:15 +02:00
5fc2c1f49c MXS-2220 Store server ports as integers and modify them in methods 2019-01-03 12:13:15 +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
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
6209d737e9 MXS-2220 server_alloc returns internal type
Also adds default initializers to SERVER fields.
2018-12-14 10:31:57 +02:00
711fbd4f19 MXS-2196: Fix removal of failed listeners
When a listener was created at runtime but it failed to start, it would
not be automatically removed from the system. This caused the MaxCtrl
cluster sync test to fail.
2018-12-04 11:50:43 +02:00
b3fbc6aa3d MXS-2196: Remove DCB from Listener
Replaced the DCB with a single file descriptor that the listener listens
on and which is added to all of the workers. The Listener also extends the
MXB_POLL_DATA which allows it to handle epoll events.

Moved the code that creates the listening socket into listener.cc where it
belongs and did a minor cleanup of it.
2018-12-04 11:50:43 +02:00
45827dd433 MXS-2196: Store listener reference in DCB
By storing the reference in the DCB, the two-way dependency between the
listeners and services is severed. Now the services have no direct link to
listeners and after the destruction of a listener it will be freed once
all connections through it have closed.

Due to the fact that a listener itself has a DCB that must point to a
valid listener, a self-reference is stored in the listener DCB. This is
extremely confusing and is only here to keep the code functional until the
DCB part of the listener can be factored out.
2018-12-04 11:50:43 +02:00
a10b6c2e89 MXS-2196: Take Listener into use 2018-12-04 11:39:52 +02:00
330719c8f9 MXS-2196: Store listener references in Service
By storing a shared pointer to the listeners in the services, they will be
available as long as the service using them exists. This enables clean
destruction of listeners that still have open sessions.

The listener creation code now separately creates the listener and links
it to the service. Also replaced relevant parts of the related code with
the listener implemented versions of it.
2018-12-04 11:39:52 +02:00
bb295b5cbe MXS-2196: Remove listeners from services
All access to the listeners of a service are done via the listener
functions.
2018-12-04 11:39:51 +02:00
756593a718 MXS-2205 Combine maxscale/router.h with maxscale/router.hh 2018-12-03 15:28:06 +02:00
36792607d8 MXS-2205 Combine internal/modules.h with internal/modules.hh 2018-12-03 13:36:25 +02:00
b15f43bc81 MXS-2205 Convert config_runtime.h and externcmd.h to .hh 2018-12-03 13:34:33 +02:00
344c7dde4a MXS-2205 Combine internal monitor headers
Contents of monitor.h moved to monitor.hh
2018-12-03 13:32:09 +02:00
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
b05385e0ac Cleanup monitor stop/start during runtime modification
The stop/start between different callers of do_alter_monitor was
confusing.
2018-11-06 11:44:50 +02:00
fe3900be0e MXS-2102 Allow runtime change of disk_space_threshold for monitor
This is currently disallowed for the server parameter, as the value could be
read/written concurrently. The monitor parameter can be changed since the
monitor is stopped during write.
2018-11-06 11:44:50 +02:00
47d2898818 MXS-2121: Allow destruction of static listeners
If a listener is defined in a static configuration file, it can now be
destroyed at runtime. If MaxScale is restarted, the listener will be
created again unless the configuration file is modified.
2018-10-31 09:53:49 +02:00
4be5d9267d Fix writeq_high_water and writeq_low_water
The parameters were never read at startup and could not be modified at
runtime. Also the values were only read once at startup.
2018-10-20 11:53:57 +03:00
50451166bb MXS-2067: Remove spinlock.hh
Replaced the C++ versions with standard library mutexes.
2018-09-28 12:18:23 +03:00
71ffef5708 Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
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
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
73288829b5 Remove default values for protocol
The parameter is the module name so it needs to be in the configuration.
2018-08-29 11:23:00 +03:00
e260d493fd Disallow duplicate server parameters
By replacing server_add_parameter and server_update_parameter with a
single server_set_parameter function, duplication of parameters is
prevented.
2018-08-29 11:23:00 +03:00
3eb7072972 MXS-1929: Improve runtime monitor creation
The monitor JSON is now more closely inspected before the actual monitor
is allocated. This prevents creation of monitors without credentials which
was previously possible.

The monitor alteration was also changed to stop and start the monitor only
once instead of stopping and starting after each parameter
modification. This prevents multi-parameter updates from failing due to
monitors seeing a partial set of the new values. Currently only the
`replication_user` and `replication_password` parameters could cause this.
2018-08-23 15:46:47 +03:00
fe124b79cc MXS-1929: Fix state of services created at runtime
If a service was created at runtime, it would be in the Allocated state
until it was stopped. The serviceStart function isn't necessary from a
functional point of view (a new service cannot have listeners that need
starting) but it does set the correct state and it's the "right" thing to
do.
2018-08-23 15:46:46 +03:00
065ee50d53 MXS-1929: Start monitors after creation
Monitors created via the REST API that were started and configured
successfully should also be started. This removes the extra step of
starting the monitor after creating it.
2018-08-23 15:46:46 +03:00
276ff70506 MXS-1929: Prevent alterations to filters and servers
These parameters must not be altered at runtime via the `alter service` or
`alter monitor` commands.
2018-08-22 16:43:17 +03:00
3f53eddbde MXS-2020 Replace ss[_info]_dassert with mxb_assert[_message] 2018-08-22 11:34:59 +03:00
02ed338afa Remove mxs::Closer<json_t*>
As std::unique_ptr can now be used with a json_t, there's no need for the
closer.
2018-08-20 13:57:00 +03:00
0a0623003e MXS-1929: Factor out parameter validation
The parameter validation for all module types follows roughly the same
path: first check whether it's a known parameter and then whether the
value is valid. This can be moved into common functions that removes
duplicated code.
2018-08-20 13:57:00 +03:00
20994351ef MXS-1929: Fix SSL JSON detection
The SSL initialization should only be attempted if `ssl_key`, `ssl_cert`
or `ssl_ca_cert` is defined. In addition to this, the SSL parameters
requirements for servers and listeners are different: servers require only
`ssl_ca_cert` but listeners require all three.
2018-08-20 13:57:00 +03:00
eddae78b42 Remove repurposing of servers
This was not very safe or correct. For example statistics and parameters
were reused by a new server.
2018-08-20 13:57:00 +03:00
a9ff2a7056 MXS-1929: Serialize objects using parameters
The main "non-static" objects are now serialized using their
parameters. This makes it possible to use common code for most modules.
2018-08-20 13:56:59 +03:00
e2ace578d2 Validate parameters before storing them
The runtime modification of servers, services and monitors now validates
the parameters before starting the update process. This guarantees that
the set of parameters is valid before it is processed.

After the validation, the parameters are now also stored in the list of
configuration parameters. This will simplify the serialization process by
removing the need to explicitly serialize all common object parameters.
2018-08-20 13:56:59 +03:00
aaad63ee5e MXS-2008 Move content of maxscale/platform.h to maxbase/cdefs.h
No good reason for keeping that platform adjustments anywhere
else but in cdefs.h.
2018-08-20 11:15:14 +03:00
f3f802cabe MXS-2008 Move maxscale/atomic.h to maxbase/atomic.h 2018-08-15 08:44:39 +03:00
419aefb173 Update basic monitor parameters
All of the monitor parameters are now kept up to date when they are
altered. This simplifies the parameter list generation for the REST API.
2018-08-14 15:08:51 +03:00
46dee98b25 MXS-1929: Report runtime module loading errors to users
If a module is not found, a proper error message is now given to the
user. Other system errors are also printed if errno is set. Dynamic
library errors aren't printed as they are apparently reset after a call to
`dlerror`, at least according to documentation.
2018-08-13 10:28:03 +03:00
6661680c4e MXS-1929: Add direct filter relationship updates
The filters of a service can now be directly updated via the relationships
endpoint.
2018-08-10 09:53:33 +03:00
290dcff48e Add runtime size type check
Took the size type validity check function into use in runtime
configuration. This fixes the problem with zero not being accepted as a
valid size for query_classifier_cache_size.
2018-08-10 09:50:54 +03:00
f14380243b Rename cppdefs.hh to ccdefs.hh
For obvious reasons; the c++ suffix is .cc and not .cpp
2018-08-10 07:50:18 +03:00