Commit Graph

210 Commits

Author SHA1 Message Date
f9b1a0a0c4 Merge branch '2.3' into 2.4 2019-07-10 08:17:34 +03:00
e658dca4fe Allow rapid reloading of users on startup
This fixes the test failures that stem from users being created right
after maxscale has started. This also should make startups a bit smoother
now that the default value of users_refresh_time has been fixed.
2019-07-08 11:32:16 +03:00
0ba779d5a2 Update 2.4.0 Change Date 2019-06-25 10:11:55 +03:00
1fbb57f9b2 Check if socket server is MaxScale service
We need to handle the case that a MaxScale service is used as a
server over Unix domain sockets.
2019-06-20 11:05:00 +03:00
4efa9dbeea Remove maxscale/alloc.h
The remaining contents were moved to maxbase/alloc.h.
2019-06-10 14:11:25 +03:00
e078f95a42 MXS-1550 Add net_write_timeout paramater for service
net_write_timeout is used to timeout writes take too long.
2019-06-10 10:31:35 +03:00
47ebcdcc02 Sort server relationships
As server relationships are unordered, sorting them guarantees a certain
order. This fixes the MaxCtrl cluster diff test failure.

Also formatted monitor.cc sources: the indentation seems to be off.
2019-05-24 15:33:17 +03:00
93e130bb48 MXS-2329 Use durations with max_retry_interval 2019-04-30 13:02:53 +03:00
9fb4116bf5 MXS-2329 Use durations with connection_timeout 2019-04-30 13:02:53 +03:00
1417292f0d Destroy monitor only if it's not used
If a service uses a monitor as the source of its servers, it must not be
destroyed before the monitor is removed from all services that use it.
2019-04-02 10:08:59 +03:00
e659c6cc73 Merge branch '2.3' into develop 2019-04-01 13:24:30 +03:00
48791c3877 Fix duplication of the router parameter
The service parameter list had two router entries in it due to the
assumption that the parameter list never contained the router itself in
it.
2019-03-29 10:35:41 +02:00
203bba0e1d Add support for multiple runtime error messages
Storing all the runtime errors makes it possible to return all of them
them via the REST API. MaxAdmin will still only show the latest error but
MaxCtrl will now show all errors if more than one error occurs.
2019-03-21 18:19:10 +02:00
e7abc53b70 MXS-2304 Clean up configuration serialization
The parameters are now written in the order they appear in the module
parameter definitions. Also enabled a previously disabled part in
server unit test.
2019-03-12 12:51:23 +02:00
1c3a5bda83 Merge branch '2.3' into develop 2019-03-11 12:29:56 +02:00
7f27db02a8 Fix global retain_last_statements
The default value was wrong.
2019-03-08 14:45:18 +02:00
95317725ce Merge branch '2.3' into develop 2019-03-07 16:21:03 +02:00
267ec9cccc Fix filter serialization
Filters were serialized with commas as separators instead of pipes.
2019-03-07 16:02:49 +02:00
2a63fb0776 MXS-2304 Store config parameter container as value in monitor and service 2019-02-22 16:53:17 +02:00
5828c93112 MXS-2304 Convert static config parameter methods to non-static
Parameter handling changed in several places.
2019-02-22 15:17:55 +02:00
b64e9b3ee0 MSX-2304 Store configuration parameters in a map
Also adds begin() and end() functions for loops.
2019-02-22 15:04:14 +02:00
37db656cae Use correct service name and router module name
Both the base class and derived class had the fields, but the derived fields
were left blank.
2019-02-20 10:50:22 +02:00
1fed465fdb MXS-2246 Remove duplicate info in SERVICE and Service
Both of them contained fields for the service and router names.
Now the names are in SERVICE and they must be accessed via member
function.
2019-02-14 15:24:10 +02:00
ab93216064 MXS-2314 Server added to monitor should be added to service
If the servers of a service are defined by a monitor (the config
has 'cluster=SomeMonitor'), then the addition of a server to a
a monitor should lead to that server being added to the service.
2019-02-11 13:03:18 +02:00
f271c5cea1 MXS-2314 Add 'cluster' parameter to service
Using the cluster parameter, the servers of a service can be
defined using a monitor.

This change basically only introduces the parameter.
2019-02-11 13:03:18 +02:00
35ab911d5c MXS-2304 Use configuration class methods instead of separate implementations
Replaces parameter add/set/remove/free.
2019-02-07 13:51:16 +02:00
ed80680da9 MXS-2304 Add ctor/dtor and other functions to parameter class
The manipulation functions are currently static so that the container can be initialized
if required. This will be fixed later.

The new functions are taken into use in monitor management.
2019-02-07 13:51:16 +02:00
5ab7734e9d MXS-2304 Add contains() to test if a parameter exists
Replaces uses of config_get_param() in modules either with contains()
or get_string(). The config_get_param() is moved to internal headers,
as it allows seeing inside a config setting.
2019-02-06 12:36:23 +02:00
4132c9bbbc MXS-2304 Use get_c_str_copy instead of config_copy_string()
Also uses get_string() in core-code when appropriate.
2019-02-05 10:28:37 +02:00
b357717149 MXS-2304 Use get_bool() instead of config_get_bool() 2019-02-01 17:18:49 +02:00
c8a84cebd0 MXS-2304 Use get_integer() instead of config_get_integer() 2019-01-31 18:12:25 +02:00
45bfbbdd9e Convert maxscale/protocol.h to .hh 2019-01-15 17:26:26 +02:00
e179395819 MXS-2218 Replace housekeeper task with delayed call 2019-01-08 16:01:36 +02:00
b16ee3a94e MXS-2220 Move server_is_active inside the class 2019-01-07 16:10:15 +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
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
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
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
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
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
bec9455a74 MXS-2205 Combine routingworker.h with routingworker.hh 2018-12-05 11:12:20 +02:00
d96a7dedc5 MXS-2205 Convert maxscale/poll.h to .hh 2018-12-04 14:51:02 +02:00
7aa60b4a24 MXS-2196: Start listeners after worker threads
If the startup of the listeners requires communication with all of the
workers, the workers must be up and running for that to happen.

Due to the fact that the main thread is still a worker thread, the
initialization code is not extra straightforward. By queuing an event to
the main worker, the startup of all listeners is done at a fully
operational state with all workers fully functional.

The service initialization code was also flawed in the sense that it would
cause a deadlock if any of the threads would have to check for the user
permissions. This is mainly a problem with the authenticator modules but
the benefits of the per service pre-loading of users is most likely
superficial. In theory startup will be faster as each thread now queries
the users in parallel.
2018-12-04 11:50:43 +02:00
015c581a5b MXS-2196: Remove unnecessary functions
The functions for starting listeners aren't needed as the listen method
can be called directly.
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
7ea22c3d16 Execute service_internal_restart on main worker
The task needs to be executed on a routing worker as it accesses
authenticator data that at least for MySQLAuth is worker specific.
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
ad12ff6d06 MXS-2196: Rename dcb.h to dcb.hh 2018-12-04 11:50:43 +02:00