12388 Commits

Author SHA1 Message Date
Esa Korhonen
405b4de1dd MXS-2220 Move MxsDiskSpaceThreshold definition to SERVER
Reduces include-clutter a bit.
2018-12-14 10:32:25 +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
Markus Mäkelä
7cf73e0f13
MXS-2196: Fix use of DCBs in binlogrouter
The binlogrouter now handles the DCB creation a bit more correctly but it
still breaks a few of the rules.
2018-12-13 13:27:45 +02:00
Markus Mäkelä
a40e2f94f3
Fix file descriptor assertions
Zero is a valid file descriptor and no negative values other than -1 are
ever stored in the DCB::fd member.
2018-12-13 13:27:45 +02:00
Markus Mäkelä
ae62cf6eb6
MXS-2196: Fix DCB session check
The check was missing the special case of persistent connections.
2018-12-13 13:27:45 +02:00
Markus Mäkelä
20fe9b9dca
MXS-2196: Rename session states
Minor renaming of the session state enum values. Also exposed the session
state stringification function in the public header and removed the
stringification macro.
2018-12-13 13:27:45 +02:00
Markus Mäkelä
7aaadfc550
MXS-2196: Fix dcb error flag assignment
The error flag was set before the function was called which caused the
function to never be used. As the core should handle the filtering of
multiple errors on the same DCB, the protocol modules should not check it.
2018-12-13 13:27:45 +02:00
Markus Mäkelä
01ba8bf886
MXS-2196: Fix freeing of resources on failed accept
When an attempt to accept a client DCB fails, the session should only be
deleted directly if the allocation of the client DCB fails. Otherwise the
closing of the DCB triggers the session deletion.
2018-12-13 13:27:44 +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
Johan Wikman
c7d5794953 Load storage library from build location during test
Without this change, the storage library is not found unless
MaxScale has been installed.
2018-12-12 13:38:53 +02:00
Niclas Antti
1ad4b339dc MXS-2025 Make variables that should be private private 2018-12-11 15:11:25 +02:00
Esa Korhonen
f7822c20e4 MXS-2196: Remove authenticator default value
The authenticator can be chosen by the protocol module if no value is
specified. By having a default parameter, this code would never get
called.
2018-12-11 13:58:00 +02:00
Esa Korhonen
8a8ac26e32 Cleanup monitor.hh
Also removes an unused field from several monitors.
2018-12-11 10:41:56 +02:00
Esa Korhonen
e979a73cc0 Remove the STRSRVSTATUS macro
Use server_status() instead.
2018-12-10 15:55:07 +02:00
Esa Korhonen
86574c16fb Return std::string in server_status() 2018-12-10 15:55:07 +02:00
Johan Wikman
08ed764675 MXS-2197 Rename all .h files under server to .hh 2018-12-10 13:07:23 +02:00
Johan Wikman
0927a0b938 MXS-2197 Remove most includes of maxscale/log.hh
All cc-files should include maxscale/ccdefs.hh, which includes
maxscale/log.hh. Consequently it need not be included again.
2018-12-10 13:07:23 +02:00
Johan Wikman
dc8c2f27f7 MXS-2197 Rename all module include files from .h to .hh 2018-12-10 13:00:46 +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
Johan Wikman
60cbeaf287 MXS-2208 Compile classify as C++ 2018-12-10 12:50:07 +02:00
Johan Wikman
d44cf7b20e MXS-2208 Allow dbfw parser to be compiled as C
maxsbase/log.h will turn into C++, but the flex and bison
generated files are by default C.
2018-12-10 12:50:07 +02:00
Johan Wikman
80805292ef MXS-2208 Compile avro as C++
An unantecipated sidestep in the path of introducing a small
HTTP library to maxbase.
2018-12-10 12:50:07 +02:00
Esa Korhonen
f2fcf79fb2 Cleanup server.hh
Simplify type definitions.
2018-12-05 16:45:32 +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
Markus Mäkelä
3cc34f0696
MXS-2196: Don't loop over persistent connections
When doing a loop over each DCB, don't process DCBs without sessions. For
now this is correct behavior as only DCBs in the persistent pool have no
session.
2018-12-05 15:30:44 +02:00
Markus Mäkelä
77477d9648
MXS-2196: Rename dcb_role_t to DCB::Role 2018-12-05 15:30:44 +02:00
Esa Korhonen
0b9241913c Merge branch '2.3' into develop 2018-12-05 13:45:24 +02:00
Esa Korhonen
467231480f Merge branch '2.3.2' into 2.3 2018-12-05 13:27:39 +02:00
Johan Wikman
8d77ddec63 MXS-2208 Add simple Http library
- Built on top of Curl
- Currently only GET
2018-12-05 12:48:42 +02:00
Esa Korhonen
bec9455a74 MXS-2205 Combine routingworker.h with routingworker.hh 2018-12-05 11:12:20 +02:00
Esa Korhonen
9f721f725e MXS-2205 Convert maxscale/protocol/mysql.h to .hh 2018-12-05 11:12:20 +02:00
Niclas Antti
0d09b56f58 MXS-2025 RWBackends as a vector of unique_ptr:s
For lifetime management keep RWBackends in a vector of unique_ptrs.
RWSplitSession keeps the unique_ptrs very private, and provides a vector
of plain pointers for all other interfaces.
2018-12-05 10:23:57 +02:00
Niclas Antti
91f6f374a8 MXS-2025 Use PRWBackends in backend selection. 2018-12-05 10:23:57 +02:00
Niclas Antti
20b62a3f3d MXS-2025 Change RWBackend usage to a vector of raw ptrs.
This is essentially just a search and replace to change SRWBackend to
RWBackend* and SRWBackendList to PRWBackends, a vector of a raw
pointers. In the next few commits vector<unique_ptr<RWBackend>>
will be used for life time management.

There are a lot of diffs from the global search and replace. Only a few manual
edits had to be done.

list-src -x build | xargs sed -ri 's/SRWBackends/prwbackends/g'
list-src -x build | xargs sed -ri 's/const mxs::SRWBackend\&/const mxs::RWBackend\*/g'
list-src -x build | xargs sed -ri 's/const SRWBackend\&/const RWBackend\*/g'
list-src -x build | xargs sed -ri 's/mxs::SRWBackend\&/mxs::RWBackend\*/g'
list-src -x build | xargs sed -ri 's/mxs::SRWBackend/mxs::RWBackend\*/g'
list-src -x build | xargs sed -ri 's/SRWBackend\(\)/nullptr/g'
list-src -x build | xargs sed -ri 's/mxs::SRWBackend\&/mxs::RWBackend\*/g'
list-src -x build | xargs sed -ri 's/mxs::SRWBackend/mxs::RWBackend\*/g'
list-src -x build | xargs sed -ri 's/SRWBackend\&/RWBackend\*/g'
list-src -x build | xargs sed -ri 's/SRWBackend\b/RWBackend\*/g'
list-src -x build | xargs sed -ri 's/prwbackends/PRWBackends/g'
2018-12-05 10:23:57 +02:00
Esa Korhonen
a6cacbec17 Update MariaDBMonitor documentation
Updates troubleshooting section.
2018-12-04 18:05:38 +02:00
Esa Korhonen
d96a7dedc5 MXS-2205 Convert maxscale/poll.h to .hh 2018-12-04 14:51:02 +02:00
Markus Mäkelä
4dd2dad426
Fix maxsql dependencies
The connector-c was not declared as a dependency which caused parallel
builds to fail.
2018-12-04 14:00:34 +02:00
Markus Mäkelä
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
Markus Mäkelä
ceb6094623
MXS-2196: Fix filter unit tests
Fixed the use of DCBs and sessions in the mock testing framework and
adapted them to the changes done to the objects in question. Extended the
testing utility functions to allow preloading modules as well as making it
possible to only partially initialize the query classifier.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
4b8393b2ee
MXS-2196: Fix most NPM unit test failures
The REST API and MaxCtrl tests relied upon the implicit sessions that were
created by the listeners. This can be corrected and improved by creating
an actual connection to MaxScale to check that a client session is indeed
created.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
cb18670013
MXS-2196: Fix core unit tests
Fixed the tests so that they properly allocate a service and a listener
for it after which a new session and a DCB are created.
2018-12-04 11:50:43 +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ä
692127a2cb
MXS-2196: Remove the dummy session
As each connection now immediately gets a session the dummy session is no
longer required. The next step would be to combine parts of the session
and the client DCB into one entity. This would prevent the possibility of
a client DCB with no associated session. Backend DCBs are different as
they can move from one session to another when the persistent connection
pool is in use.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
a2f5cc9d09
MXS-2196: Rename struct session to struct MXS_SESSION 2018-12-04 11:50:43 +02:00
Markus Mäkelä
da9816b7e7
MXS-2196: Always allocate a session
Whenever a client DCB is accepted, a session for it is allocated. This
simplifies the handling of shared data between DCBs by allowing it to be
placed inside the session object. Currently, the data is stashed away in
the client DCB.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
180e150ba1
MXS-2196: Split session startup into two parts
The session allocation now has two distinct parts: the initialization of
the session itself and the creation of the router and filter
sessions. This allows sessions to be allocated the moment a client DCB is
created instead of only after the authentication is complete. With this
change, the need for the dummy session is removed.
2018-12-04 11:50:43 +02:00