Commit Graph

3902 Commits

Author SHA1 Message Date
684ec3288b Rename and cleanup authenticator.h 2019-01-14 15:07:33 +02:00
b4d91d4b9a Move query result helper class to maxsql
Added some asserts to ensure the class is used correctly.
2019-01-14 10:43:17 +02:00
6d296f6661 MXS-2220 Move authenticator instance data to internal class 2019-01-11 11:31:27 +02:00
42215c65fa MXS-2220 Cleanup global server list handling
The list is now an array and only accessed by the owning object to ensure locking.
2019-01-11 11:31:27 +02:00
87913f8cb8 MXS-2220 Miscellaneous cleanup
Removes some duplicate includes.
2019-01-11 11:00:24 +02:00
9cac927542 MXS-2220 Move server response calculation functions inside class 2019-01-10 10:26:53 +02:00
df17619722 MXS-2220 Move server_update_address inside class
Should be moved to internal class once blr is cleaned up.
2019-01-10 10:26:53 +02:00
3ffa76b172 Fix maxscale/tasks resource
The returned JSON was simply an array of tasks.
2019-01-10 07:07:41 +02:00
5a698be45c MXS-2218 Centralize worker shutdown handling 2019-01-08 16:01:36 +02:00
e179395819 MXS-2218 Replace housekeeper task with delayed call 2019-01-08 16:01:36 +02:00
c27a24ab37 MXS-2218 If startup fails, main worker must also be shutdown 2019-01-08 16:01:36 +02:00
6ba2cb61df MXS-2218 Implement housekeeper in terms of MainWorker 2019-01-08 16:01:36 +02:00
026bf747e6 MXS-2218 Add functionality for mxs_clock 2019-01-08 16:01:36 +02:00
2d2f62ed6f MXS-2218 Add showing and to_json functionality 2019-01-08 16:01:36 +02:00
d50ae1fb8a MXS-2218 Treat all routing workers the same way
All routing workers are now started an stopped the same way.
2019-01-08 16:01:36 +02:00
35dfa05767 MXS-2218 Run MainWorker in main thread
The previous main routing worker is now run in a separate thread.
Next step is to treat all routing workers in an identical fashion.
MainWorker is not yet used for anything, but in a subsequent change
the old housekeeper functionality will be moved in top of MainWorker.
2019-01-08 16:01:36 +02:00
92306c565b MXS-2218 Add housekeeper functionality to MainWorker
In preparation for moving the housekeeper functionality on top
of MainWorker.
2019-01-08 16:01:36 +02:00
c5a4f2abdd MXS-2218 Add simple housekeeper test
So that the new worker based housekeeper can be tested.
2019-01-08 16:01:36 +02:00
10216524ab MXS-2218 Add skeleton MainWorker
First step in the introduction of a MainWorker. When finished, all
routing workers will run in separate threads (currently one runs in
the main thread), and the main worker run in the main thread.

Housekeeper will disappear and to the extent housekeeping tasks are
needed (where applicable they will be changed into delayed calls)
they will be run by the main worker.
2019-01-08 16:01:36 +02:00
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
d5c78eb31f MXS-2220 Move more server functions inside class 2019-01-08 15:12:47 +02:00
8b53e30678 MXS-2220 Move server status functions inside class 2019-01-08 15:12:47 +02:00
93aff0640c MXS-2220 Cleanup server header
Moved items around in preparation for more changes.
2019-01-07 16:10:15 +02:00
03adee2030 MXS-2220 Run uncrustify on server headers 2019-01-07 16:10:15 +02:00
b16ee3a94e MXS-2220 Move server_is_active inside the class 2019-01-07 16:10:15 +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
ade66816f1 Fix invalid read
A returned object will be destructed at the next sequence point.
2019-01-07 16:04:47 +02:00
f0f9c21d1c Merge branch '2.3' into develop 2019-01-07 10:54:42 +02:00
0859f3caff Merge branch '2.2' into 2.3 2019-01-07 10:33:34 +02:00
fe4c848079 Use direct access into strings while canonicalizing
The process of appending to a std::string always includes a size check in
case the internal storage needs to expand. Given that we know a
canonicalized version of a query string is never larger than the original
string and that we pre-allocate enough memory to cope with the worst-case
scenario, the extra logic in std::string::push_back is unnecessary and an
extra cost. Writing directly into the string avoids this cost and improves
the performance.
2019-01-03 21:37:11 +02:00
ad5b244313 Optimize canonicalization code
Switched from default character type functions to ones that use lookup
tables. Eliminated the internal state and replaced with in-place iteration
of the query. Added code to allow single-lookup detection of normal
characters.
2019-01-03 21:37:11 +02:00
87c3b1d25b MXS-2234: Extend persisted config file log message
The log message should now contain enough information to more easily debug
any configuration issues that result from updating the main config file
after runtime changes have been done.

Also fixed the theoretical race condition in detection of persisted
configuration files by only checking for their existence once.
2019-01-03 12:48:30 +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
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
ee98900685 MXS-2200: Extend REST API tests
Added test cases for static and unknown global parameters.
2019-01-03 09:37:59 +02:00
d1b098d3b0 MXS-2200 Store server version string and type in internal class 2019-01-02 12:53:52 +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
eacf88f6a5 MXS-2220 Add server version and type information struct
The old fields are still used.
2018-12-19 13:18:16 +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
405b4de1dd MXS-2220 Move MxsDiskSpaceThreshold definition to SERVER
Reduces include-clutter a bit.
2018-12-14 10:32:25 +02:00