Commit Graph

9268 Commits

Author SHA1 Message Date
396b81f336 Fix in-source builds
The internal header directory conflicted with in-source builds causing a
build failure. This is fixed by renaming the internal header directory to
something other than maxscale.

The renaming pointed out a few problems in a couple of source files that
appeared to include internal headers when the headers were in fact public
headers.

Fixed maxctrl in-source builds by making the copying of the sources
optional.
2017-11-22 18:40:18 +02:00
6054fa0957 Add dependency on libmicrohttpd for maxscale-common
The core library needs to be built after libmicrohttpd.
2017-11-22 18:37:45 +02:00
c38fbd0b74 Move utility and mock classes to .../filter/test
The utility and mock classes created for the testing of dbfwfilter
will be used for testing certain aspects of the cache filter.
Consequently better to move them somewhere outside dbfwfilter.
Sofar they will be built separately for each filter.
2017-11-22 10:00:34 +02:00
70bf901102 Fix build failures caused by merge
A variable was not added that was used and a comparison between signed and
unsigned integers was made.
2017-11-21 16:54:24 +02:00
afcb708e6e Merge branch '2.1' into 2.2 2017-11-21 16:49:21 +02:00
dd699f2739 Update release date. 2017-11-21 14:36:15 +02:00
30e154bc6f Add missing python schema generator documentation
The documentation for the Python 3 version of the schema generator was
missing.
2017-11-20 15:22:35 +02:00
bc7209c04e cache: Update test-program due to qc-changes
In 2.2 it is no longer possible to know where a particular column
appears. Hence the result when a column appears amongst the selected
columns and the where-clause must be the same.
2017-11-20 15:21:46 +02:00
fc8c25803a cache: Perform thread initialization in test program 2017-11-20 15:19:54 +02:00
cd89b976a9 cache: Fix iteration of rules
Incrementation of index ended up outside iteration block at
earlier refactoring.
2017-11-20 15:18:17 +02:00
1c58df8307 qc_sqlite: Copy database if tables are copied
To be able to correctly report the fullname of a table we must
copy the database, if it is available.
2017-11-20 15:15:58 +02:00
604502e1cb MXS-1461 Template Module -> class Module + template SpecificModule 2017-11-20 13:14:02 +02:00
25e288b571 MXS-1461 Add firewall test cases 2017-11-20 13:14:02 +02:00
8abe5a659e MXS-1461 Allow user and host to be exluded in test cases 2017-11-20 13:14:02 +02:00
a596e1a77c MXS-1461 Move client data to Client
The user and host are now in Client.
2017-11-20 13:14:02 +02:00
083c3bcad7 MXS-1461 Rename Upstream to Client 2017-11-20 13:14:02 +02:00
a35a4c7e9f MXS-1461 Modify mock classes 2017-11-20 13:14:02 +02:00
8fba2a8049 MXS-1461 Add local firewall filter tests
Only two now, more to be added.
2017-11-20 13:14:02 +02:00
da989d636e MXS-1461 Add TempFile
Class for creating a temporary file.
2017-11-20 13:14:02 +02:00
edb271fa8e MXS-1461 Modify some mock-classes 2017-11-20 13:14:02 +02:00
843c9b0ce1 MXS-1461 Add mock Upstream class
Upstream can be used as the upstream filter of a filter to
be tested.
2017-11-20 13:14:02 +02:00
8aeb49cffa MXS-1461 Add FilterModule class 2017-11-20 13:14:02 +02:00
815da1b7ad MXS-1461 Add mock RouterSession 2017-11-20 13:14:02 +02:00
1edccba885 MXS-1461 Add mock Backend class 2017-11-20 13:14:02 +02:00
d2c80d2e91 MXS-1461 Add QueryClassifierModule 2017-11-20 13:14:02 +02:00
531a8bafbd MXS-1461 Add mock classes Session and Dcb 2017-11-20 13:14:02 +02:00
65cf491350 MXS-1461 Add general purpose mocking functions 2017-11-20 13:14:02 +02:00
e434c7ec66 MXS-1461 Add template Module
This is the first in a series of commits that introduce components
that allow filters to be tested without MaxScale or backends.
Obviously the environment is not suited for all cases, but allow e.g.
the behaviour of the firewall filter to be tested in isolation.

The environment consists of helper classes loading and manipulating
modules and filters and mock-classes that provide the needed
scaffolding around a filter.

Currently all components exist under the test directory of the firewall
filter, but once proven they can be moved to a more general purpose
location.
2017-11-20 13:14:02 +02:00
8077d97e25 MXS-1513: Work around the backend_read_timeout-setting
The setting limits the maximum time a MASTER_GTID_WAIT-function
can wait. To work around this limitation, the function is now called
in a loop such that the total timeout is approximately equal to
the requested timeout.
2017-11-20 12:31:11 +02:00
59616b5f3e MXS-1490: Cleanup error printing, add json error
Slave redirection is a special case, as there the total failure
is only known after all redirects have been attempted. In the
failure case, all errors from connections are gathered to one
message.
2017-11-20 11:33:47 +02:00
204fa17322 MXS-1519 Prevent "inheritance" of fw rules
By using an the value of a global incremented integer as the
initial version number of a Dbfw instance it is ensured that every
such instance does not "inherit" any rules from a previous instance
that happened to exist in the same place as the new instance to be
created.
2017-11-20 10:11:23 +02:00
8c72b9d233 Update release docs for 2.1.11 2017-11-20 09:50:21 +02:00
07e58444f6 Improve error message for zero monitor timeout values
The error message was not 100% accurate about the value. In addition to
that, neither the value itself nor the monitor or parameter names were
printed in the error message.
2017-11-17 18:05:03 +02:00
84d1ea0bff MXS-1490: Perform failover only after failcount monitor loops
The same failcount variable is used for the detect_standalone_master-
feature.
2017-11-17 10:12:33 +02:00
703230a930 Only write monitor journal when it changes
The state of the monitored servers is only persisted if the states of the
servers have changed. This removes the unnecessary disk IO caused by the
writing on the monitor journal.
2017-11-16 15:38:13 +02:00
db61ec0d7e Add missing initialization in readwritesplit
A value was not always initialized for all queries when info level logging
was enabled.
2017-11-16 15:38:13 +02:00
e0b8ab0b9c Fix memory leak when users are dumped
When users are dumped to file, the JSON object wasn't freed.
2017-11-16 15:38:12 +02:00
decd5578bc MXS-1525 Check exact match first when checking host
Given a rule like

  ...
  users %@127.0.0.1 match any rules ...

the code started with %@127.0.0.%, which meant that the exact
match rule would be missed.
2017-11-16 14:09:28 +02:00
11a240cb15 MXS-1519 Use fw instance specific rules and users
The rules and users need to be distinct not only for each thread
but for each instance and thread.
2017-11-16 14:06:50 +02:00
b63c6504a3 MXS-1513: Switchover script
First version of switchover script. Unsafe to run as it has no
timeouts for most queries. Also, removed code launching the
previous switchover_script.
2017-11-16 10:51:12 +02:00
032b2f3846 MXS-1333: QLAFilter, add option to log execution time
Adds an option 'reply_time' to log_data. When enabled, query execution time
in milliseconds is logged. Execution time is measured as the time between
routeQuery and the first clientReply.
2017-11-15 16:56:39 +02:00
7cc4018c15 Use SQLSTATE 08S01 for hangup errors
This will tell the connectors that the connection cannot be used.
2017-11-15 15:00:40 +02:00
060a96d7f3 Send error on client DCB hangup events
Sending an error to the client allows the connector to show more
information to the user when the DCB is closed due to a reason internal to
MaxScale.

The error message states that the connection was killed by MaxScale to
distinct it from the error sent by the server. The error number and SQL
state are still the same as both errors should be treated the same way.
2017-11-15 14:57:28 +02:00
fbdd6601e9 Combine TLS/SSL documentation
The TLS/SSL documentation is now defined in one place. The documentation
states that both servers and listeners use the same parameters.
2017-11-15 10:11:37 +02:00
5d6f7e3fbd Add 2.1.11 release notes
Added 2.1.11 release notes.
2017-11-15 09:42:29 +02:00
4280ec7ee8 MXS-1019: Update SSL documentation
Added ssl_verify_peer_certificate documentation for listeners and servers.
2017-11-14 23:09:26 +02:00
fca11f992a Fix verify_master_failure
The test expected the wrong error message to be in the log. To better cope
with changes in the text, the test now uses a regular expression to do the
matching.
2017-11-14 16:53:09 +02:00
f41111b4bd MXS-1517: Retain stale master bit even on master failure
If a server goes down and it has the stale master bit enabled, all other
bits for the server are cleared. This allows failed masters that have been
replaced to be first detected and then reintroduced into the replication
topology.
2017-11-14 16:53:09 +02:00
b80f394cd0 Use explicit types
Use uint64_t instead of unsigned. This guarantees that the size of the
type is the same across all platforms.
2017-11-14 16:53:09 +02:00
63ae436bd5 MXS-1019: Make peer certificate verification configurable
The new `ssl_verify_peer_certificate` parameter controls whether the peer
certificate is verified. This allows self-signed certificates to be
properly used with MaxScale.
2017-11-14 16:51:34 +02:00