13495 Commits

Author SHA1 Message Date
Johan Wikman
075ed00f58 MXS-2481 Fix rebase error 2019-05-28 12:43:21 +03:00
Johan Wikman
6e5f7fcfbf MXS-2481 Add timeout and comments
When node is taken down, we don't wait forever.
Added comments that make it easier to follow the test when it
is running.
2019-05-28 12:36:21 +03:00
Johan Wikman
dcc7d195a3 MXS-2481 Add/fix copyright blurb 2019-05-28 12:36:21 +03:00
Johan Wikman
71b648e965 MXS-2481 Test transaction replay at group change
Take down a node other than the one we are connected to, which
will cause a group change error, and test that MaxScale catches
that and replay the transaction.
2019-05-28 12:36:21 +03:00
Johan Wikman
e0b397455d MXS-2481 Check that server has changed 2019-05-28 12:36:21 +03:00
Johan Wikman
1c3ccfe254 MXS-2481 Factor out functionality
To be used by other test-case.
2019-05-28 12:36:21 +03:00
Johan Wikman
37e526eb8d MXS-2481 Rename test
No other changes.
2019-05-28 12:36:21 +03:00
Johan Wikman
2bcee1be8b MXS-2481 Test transaction replay when node goes down
Currently tests transaction replay when node goes down.
Group change test will be added and name of test will be
changed accordingly.
2019-05-28 12:36:21 +03:00
Johan Wikman
60d065473e MXS-2481 Handle sqlite3 oom error 2019-05-28 12:36:21 +03:00
Johan Wikman
feae0cda17 MXS-2481 Dont log confusing things
At first start there will be no persistent information. No point
in logging that we will not use that information.
2019-05-28 12:36:21 +03:00
Johan Wikman
1bd82555d9 MXS-2481 Add Clustrix group change test skeleton 2019-05-28 12:36:21 +03:00
Johan Wikman
7b803f621c MXS-2481 Change blurb 2019-05-28 12:36:21 +03:00
Johan Wikman
8204c5099b MXS-2481 Ensure directory exists before creating db 2019-05-28 12:36:21 +03:00
Johan Wikman
8a2c43d297 MXS-2481 Add configuration file template 2019-05-28 12:36:21 +03:00
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