7767 Commits

Author SHA1 Message Date
Johan Wikman
7cac2c009d Merge branch '2.3' into develop 2019-01-10 12:43:46 +02:00
Esa Korhonen
9cac927542 MXS-2220 Move server response calculation functions inside class 2019-01-10 10:26:53 +02:00
Esa Korhonen
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
Markus Mäkelä
46eddc8102
Rename ReadConn to RCR
RCR is more compact and looks neat.
2019-01-10 07:16:42 +02:00
Markus Mäkelä
5613f31bc7
Clean up readconnroute
Moved method documentation into the headers and removed the local
variables storing pointers to this.
2019-01-10 07:16:42 +02:00
Markus Mäkelä
d6df5a7d6a
Use router template in readconnroute 2019-01-10 07:15:45 +02:00
Markus Mäkelä
54589424f9
Use more C++ code in readconnroute
Allocations are now done with new and casts are done using
static_cast. Removed revision history and cleaned up some assertions.
2019-01-10 07:12:31 +02:00
Markus Mäkelä
b30b743455
Rename readconnroute structures
Renamed them with the C++ coding style in mind.
2019-01-10 07:12:30 +02:00
Markus Mäkelä
5da833187c
Rename readconnroute header
The name now reflects the module and source code name.
2019-01-10 07:12:30 +02:00
Markus Mäkelä
3ffa76b172
Fix maxscale/tasks resource
The returned JSON was simply an array of tasks.
2019-01-10 07:07:41 +02:00
Markus Mäkelä
147f0bb656
Extend master failure error message
The error now describes the failure mode in more detail. This should make
post mortem analysis of failed connections a lot easier.
2019-01-09 20:05:38 +02:00
Johan Wikman
5a698be45c MXS-2218 Centralize worker shutdown handling 2019-01-08 16:01:36 +02:00
Johan Wikman
29b6e53eb8 MXS-2218 Replace mq housekeeper task with delayed call 2019-01-08 16:01:36 +02:00
Johan Wikman
e179395819 MXS-2218 Replace housekeeper task with delayed call 2019-01-08 16:01:36 +02:00
Johan Wikman
c27a24ab37 MXS-2218 If startup fails, main worker must also be shutdown 2019-01-08 16:01:36 +02:00
Johan Wikman
6ba2cb61df MXS-2218 Implement housekeeper in terms of MainWorker 2019-01-08 16:01:36 +02:00
Johan Wikman
026bf747e6 MXS-2218 Add functionality for mxs_clock 2019-01-08 16:01:36 +02:00
Johan Wikman
2d2f62ed6f MXS-2218 Add showing and to_json functionality 2019-01-08 16:01:36 +02:00
Johan Wikman
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
Johan Wikman
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
Johan Wikman
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
Johan Wikman
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
Johan Wikman
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
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
49c1afcb1b Merge branch '2.3' into develop 2019-01-08 13:17:27 +02:00
Esa Korhonen
63358fb4c1 Add correct operator to comparison
The clause had a bitwise AND. The end result is likely the same.
2019-01-08 10:18:15 +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
03adee2030 MXS-2220 Run uncrustify on server headers 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
Johan Wikman
ade66816f1 Fix invalid read
A returned object will be destructed at the next sequence point.
2019-01-07 16:04:47 +02:00
Johan Wikman
f8545a0b7f MXS-2219 Address review comments 2019-01-07 12:59:57 +02:00
Johan Wikman
4512295e40 MXS-2219 Implement rudimentary Clustrix monitoring
The monitor now pings the health check ports of the Clustrix nodes.
A response translates to RUNNING and a non-response to DOWN.
2019-01-07 12:59:27 +02:00
Johan Wikman
9dce8c0c56 MXS-2163 Modify Clustrix auth query slightly
- Format specifyer was missing
- Now root shows up properly
2019-01-07 12:57:13 +02:00
Markus Mäkelä
5f83b07fc2
MXS-2241: Detect invalid readwritesplit configuration
master_reconnection and disable_sescmd_history are, in practice, mutually
exclusive settings.
2019-01-07 11:06:24 +02:00
Markus Mäkelä
f0f9c21d1c
Merge branch '2.3' into develop 2019-01-07 10:54:42 +02:00
Markus Mäkelä
0859f3caff
Merge branch '2.2' into 2.3 2019-01-07 10:33:34 +02:00
Markus Mäkelä
46bea87ff6
MXS-2238: Fix reading of large Avro schemas
The schemas were read incorrectly which resulted in large schemas having
multiple newlines in them.
2019-01-06 13:05:42 +02:00
Markus Mäkelä
8c437c6440
Fix crash in galeramon
An std::string was assigned a null value which will cause a crash.
2019-01-04 12:00:48 +02:00
Esa Korhonen
cf9ac9004e Fix compilation error
A variable had the same name as a type, which confused some compilers.
2019-01-04 10:40:11 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
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
Markus Mäkelä
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