13481 Commits

Author SHA1 Message Date
Johan Wikman
18214b1aa2 MXS-2481 Add Clustrix module-command test
Softfailing should turn the state of a server to Drained.
2019-05-28 12:36:21 +03:00
Johan Wikman
c0a0bb86a0 MXS-2481 Add MaxRest functionality
- show_server
- call_command
2019-05-28 12:36:21 +03:00
Johan Wikman
c35d92eccc MXS-2481 Check that node-absense leads to Down
If MaxScale cannot ping the health-check port of a node, the
state of the node should become 'Down'.
2019-05-28 12:36:21 +03:00
Johan Wikman
a8487a945a MXS-2481 When Clustrix [un]block health port as well
In the case of Clustrix, it is not sufficient to block the MariaDB
port alone, but the health-check port must be blocked as well.
2019-05-28 12:36:21 +03:00
Johan Wikman
0d3a235851 MXS-2481 Allow [un]block-commands to be overriden
In the case of Clustrix, there are other ports to block as well.
2019-05-28 12:25:21 +03:00
Johan Wikman
5a26bd8ce5 MXS-2481 Rename MaxCtrl to MaxRest
So as not to believe that the program depends upon or uses
maxctrl.
2019-05-28 12:25:21 +03:00
Johan Wikman
97ad45125d MXS-2481 Add simple Clustrix test 2019-05-28 12:25:21 +03:00
Johan Wikman
b837e24995 MXS-2481 Add MaxCtrl class to test framework
The purpose of this class is to make it easy from a test program
to access the output of the REST-API. Currently it provides only
the equivalent of "maxctrl list servers", but it can be extended
if and when additional needs arise.

Right now it's implemented so that curl is executed on the 0th
MaxScale instance, using the ssh mechanism of the test framework.
2019-05-28 12:25:21 +03:00
Esa Korhonen
11a8488162 Begin converting EXTERNCMD to a class
Mostly renaming for now.
2019-05-28 11:32:23 +03:00
Esa Korhonen
5043293b97 Clean up monitor_relations_to_server()
Server can only have one monitor.
2019-05-28 11:32:23 +03:00
Esa Korhonen
0f1e964192 Merge branch '2.3' into develop 2019-05-28 11:15:46 +03:00
Esa Korhonen
4d3d6e9d06 MXS-2479 Extend pam authenticator test to use a customized pam service
The test now covers additional messages being sent by the pam api.
2019-05-28 11:04:53 +03:00
Esa Korhonen
a82841333d Merge branch '2.3' into develop 2019-05-28 10:57:18 +03:00
Markus Mäkelä
dda2c1964d
Merge commit '05ed272c1627b21ff623b7fdf5a60f2ba2f4f5d0' into develop 2019-05-27 19:30:29 +03:00
Esa Korhonen
d128c9a09b MXS-2504 Kick out super-users from master server during switchover
The monitor queries for logged in users with super-privileges and kicks them out to
prevent writes to master. Normal users can stay since their writes are prevented by
read_only. Also, the master-status is removed from the master manually to signal to
routers that no more writes should go to master.
2019-05-27 18:11:46 +03:00
Markus Mäkelä
05ed272c16
Fix format-truncation warnings in blr
The custom message must be smaller than the actual message to guarantee no
truncation takes place.
2019-05-27 03:24:05 +03:00
Markus Mäkelä
a33996ab20
Remove redundant sort in monitor_relations_to_server
Servers can have only one monitor relationship.
2019-05-24 18:29:50 +03:00
Markus Mäkelä
752aa9de57
Make lambdas in monitor.cc more readable
Putting the function call and the start of the lambda on different lines
keeps the lambda contents less indented.
2019-05-24 18:26:51 +03:00
Markus Mäkelä
859e930466
MXS-2486: Make SSL configurations immutable
Changes to SSL configurations is expected to be rare which allows them to
be made into immutable objects once created. This is an acceptable
compromise between performance and usability.
2019-05-24 15:33:18 +03:00
Markus Mäkelä
52ef9afcc6
MXS-2483: Add missing deletion of defaulted functions 2019-05-24 15:33:18 +03:00
Markus Mäkelä
e5f0d3eb37
Only log one host blocking message
The message would be logged multiple times if multiple authentication
attemps failed at the same time.

Also renamed the RateLimit class method to the same as the Listener one.
2019-05-24 15:33:18 +03:00
Markus Mäkelä
c2975d33f8
MXS-2483: Fix dcb.hh includes
The header depended on ssl.hh to include the OpenSSL headers even though
it used OpenSSL types. By fixing these dependencies the ssl.h header can
now freely include the rworker_local type which removes the need for the
hidden implementation of SSLProvider.
2019-05-24 15:33:18 +03:00
Markus Mäkelä
d5ec357731
Fix binlogrouter SSL creation
The SSLContext could get invalid parameters as the router unconditionally
added all the parameters.
2019-05-24 15:33:17 +03:00
Markus Mäkelä
3af66f3309
MXS-2483: Take SSLProvider into use
Servers and listeners now have a SSLProvider member variable that is used
for all SSL related tasks.
2019-05-24 15:33:17 +03:00
Markus Mäkelä
cb72b2a5cc
MXS-2483: Move SSL functionality into SSLProvider
The class is intended to be inherited by objects that need an SSL context
and a configuration. In practice this will be servers and listeners.

The SSLContext is stored in a rworker_local shared_ptr that makes it
possible to update safely. As the copying is always done behind a lock the
cached local value always holds a valid SSLContext instance for the
duration of all function calls.

Using the pImpl idiom, the routingworker.hh header is not exposed in the
ssl.hh header. This allows the SSLProvider class to be inherited more
easily.
2019-05-24 15:33:17 +03:00
Markus Mäkelä
8a4b58d52c
MXS-2483: Move SSL configuration into SSLConfig
This way the configuration information can be accessed without the
SSLContext.
2019-05-24 15:33:17 +03:00
Markus Mäkelä
075ad1cfb3
Fix JSON representation of Listener parameters
The parameters were still hard-coded and not generated from the actual
parameters.
2019-05-24 15:33:17 +03:00
Markus Mäkelä
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
Esa Korhonen
bed28db3fd Merge branch '2.3' into develop 2019-05-24 13:55:47 +03:00
Markus Mäkelä
eda547c86f
MXS-1851: Add hard-coded protocol module check
This way a hard to track crash is avoided and the user knows how to fix
it.
2019-05-24 13:55:43 +03:00
Esa Korhonen
a1697e2aa6 MXS-2479 PAMBackendAuth is more tolerant of extra messages.
The authenticator can now receive additional questions from the server even
after the original password-query.
2019-05-24 11:31:55 +03:00
Markus Mäkelä
4e2d350838
MXS-2483: Return std::unique_ptr from SSLContext::create
Smart pointers are far nicer than raw pointers.
2019-05-24 10:05:43 +03:00
Markus Mäkelä
5b55864b06
MXS-2483: Store listener SSLContext in unique_ptr
Also removed some unnecessary checks for session->listener: The Session
constructor takes the listener as an argument.
2019-05-24 10:05:43 +03:00
Markus Mäkelä
bc500d2565
MXS-2483: Store server SSLContext in unique_ptr 2019-05-24 10:05:42 +03:00
Markus Mäkelä
9c6ec5e6c9
MXS-2483: Re-configuring SSL for servers is an error
Since listeners cannot be reconfigured, we can accept this limitation and
impose it on the servers as well. This keeps the behavior consistent and
removes the need to resolve the deletion issue (for the time being).
2019-05-24 10:05:42 +03:00
Markus Mäkelä
3b8e28392e
MXS-2483: Make server SSL private
The old server_ssl member is now renamed and private. The ssl_context and
set_ssl_context methods provide access to it.
2019-05-24 10:05:42 +03:00
Markus Mäkelä
f79e8b108c
Log end of bug601 verbosely
The test appears to fail to connect to MaxScale due to unavailability of
connections. Theoretically, the improvement in accept speed due to
SO_REUSEPORT additions could explain the faster exhaustion of available
sockets.
2019-05-24 10:05:16 +03:00
Markus Mäkelä
e72abe3643
Fix object names in mxs2450_change_user_crash 2019-05-24 10:05:16 +03:00
Markus Mäkelä
9d80b42dc6
Fix mxs2300_history_pruning config
Names with whitespace are no longer supported.
2019-05-24 10:05:16 +03:00
Markus Mäkelä
c57764a84f
Fix no_password
The test used freed memory.
2019-05-24 10:05:16 +03:00
Markus Mäkelä
7eff7f8e9e
Remove unused function in mysql_common.cc 2019-05-24 10:05:15 +03:00
Markus Mäkelä
397fc97d07
Only count actual failures as auth failures
If the authentication process fails due to an inability to start a
session, it should not be counted towards the number of failed
authentication attempts.
2019-05-24 10:05:15 +03:00
Markus Mäkelä
add488366b
Log message on when a host is blocked
To make it easier to detect when a host was blocked due to too many
authentication failures, a log message is now logged.
2019-05-24 10:05:15 +03:00
Markus Mäkelä
cb1e7b14b4
Remove debugcli from test configurations
The module has been removed in 2.4.
2019-05-24 10:05:15 +03:00
Esa Korhonen
bd8aa64547 MXS-2479 Accept additional messages in PAM authenticator
Plugins may send additional messages during authentication. These messages
often contain notifications such as password expiration dates. Both the client
and backend side authenticators now handle such messages. The messages are not
sent to the user, only the log. The requirement that only "Password: " is queried
still stands.
2019-05-23 14:14:25 +03:00
Timofey Turenko
e0c5791a6e Merge branch 'develop' of github.com:mariadb-corporation/MaxScale into develop 2019-05-23 11:29:32 +03:00
Markus Mäkelä
f8688a7285
Merge branch '2.3' into develop 2019-05-22 15:57:46 +03:00
Timofey Turenko
64935573b2 Add virtual functions check_replication() and start_replication() for Clustrix
Implementations of check_replication() and start_replication() for Clustrix allows to use fix_replication()
also for Clustrix nodes without checking it.
Also several attempts to check nodes after restart are added - to wait for nodes if they are not running
right after server daemon restart
2019-05-22 15:39:25 +03:00
Markus Mäkelä
b6b0a69440
Fix parameter option overlap
All duration parameters behaved as if they were deprecated due to the bits
overlapping.
2019-05-22 12:25:06 +03:00
Markus Mäkelä
17fa1ce616
Fix galeramon regression
The comparisons were done wrong: strcasecmp returns 0 for equal strings.
2019-05-22 10:02:48 +03:00