Commit Graph

12800 Commits

Author SHA1 Message Date
3fef15e892 MXS-2302: Remove templates from parsing code
The templates were only used to make testing easier and upon review the
gain in testing convenience wasn't large enough to warrant its use.
2019-03-04 08:48:32 +02:00
684ddfd12d MXS-2302: Use filter template in hintfilter 2019-03-04 08:48:32 +02:00
1d49e45036 MXS-2302: Do hint processing in a member function
Also fixed a unit test failure.
2019-03-04 08:48:32 +02:00
f106864659 MXS-2302: Use STL containers for hint storage
The named hints and the hint stack are now stored in STL containers.
2019-03-04 08:48:32 +02:00
a6ab05b673 Fix format-overflow warnings in tests
The tests previously ignored these warnings but the change in compiler
flags caused them to fail.
2019-03-04 08:48:32 +02:00
2045ac656b MXS-2302: Remove unused hintfilter code
Also moved the token types into the correct file.
2019-03-04 08:48:32 +02:00
ec234124b1 MXS-2302: Remove unused parsing code
Removed all code that is no longer used. The hint stack mechanism is still
in use but can, and should, be replaced with std::vector.
2019-03-04 08:48:32 +02:00
c5a8b693c3 MXS-2302: Take new hint parsing code into use 2019-03-04 08:48:32 +02:00
ca9224bf88 MXS-2302: Rewrite hint tokenization and parsing
The tokenization is somewhat crude but given the small amount of token
types it is acceptably efficient while still maintaining readability. The
parsing is quite simple to implement as a sort of a recursive descent
parser and is a lot more readable that the old state machine
implementation.

Extended the unit test to check that all supported hint types are parsed
correctly. The stack mechanism isn't fully covered by the unit test and it
needs to be added once the stack mechanism uses STL containers.
2019-03-04 08:48:32 +02:00
897fee715d MXS-2302: Use const char* in hintfilter functions 2019-03-04 08:48:32 +02:00
11be8ed0f0 MXS-2302: Add comment extraction code
The code extracts comments from a query. All three comment types are
supported and the double dash comments properly handle invalid input
(fixes MXS-2289).

The code uses iterators to access to the query and returns a list of
iterator pairs as start and end markers to comments. This makes testing
easier as the input and output can be passed as an std::string.
2019-03-04 08:48:32 +02:00
41a72bcc30 Fix config parameter related tests
The tests gave null arguments when a valid object was expected.
2019-02-25 17:10:00 +02:00
2a63fb0776 MXS-2304 Store config parameter container as value in monitor and service 2019-02-22 16:53:17 +02:00
3fa4a85a1e MXS-2304 Use values instead of pointers in CONFIG_CONTEXT
Simplifies ctor/dtor.
2019-02-22 16:39:45 +02:00
5828c93112 MXS-2304 Convert static config parameter methods to non-static
Parameter handling changed in several places.
2019-02-22 15:17:55 +02:00
b64e9b3ee0 MSX-2304 Store configuration parameters in a map
Also adds begin() and end() functions for loops.
2019-02-22 15:04:14 +02:00
a51f156372 Merge branch '2.3' into develop 2019-02-22 12:22:11 +02:00
675971bd3c MXS-2345 Query classifier collects db of USE stmt
qc_get_database_names() will now return the database used
in a USE statement.
2019-02-22 11:22:32 +02:00
37db656cae Use correct service name and router module name
Both the base class and derived class had the fields, but the derived fields
were left blank.
2019-02-20 10:50:22 +02:00
afe41c38ed Merge branch '2.3' into develop 2019-02-20 10:33:14 +02:00
c1d96d79f0 Document server port default value
The value has a default in 2.3.
2019-02-19 18:48:00 +02:00
9fbaafea91 MXS-2304 Remove additional module parameter classes
Equivalent functionality is now in the basic config parameter class.
2019-02-19 13:52:44 +02:00
48a6ab503e MXS-2292 PAM authenticator detects anonymous users with defined hosts
This allows anonymous user mapping from well-defined hosts.
2019-02-19 10:40:23 +02:00
bd3d5bb010 MXS-2329 Use durations in throttle filter 2019-02-19 10:11:57 +02:00
f3acf77a9f MXS-2329 Use durations in ccrfilter
The time window of the ccrfilter is now specified as a duration.
Internally, the time window is still always handled as seconds.
2019-02-19 10:11:57 +02:00
daf5c6b29c MXS-2332 When server is drained, report it as such
When the SERVER_BEING_DRAINED bit is on, if the number of connections
to the server is 0, the state is reported as "Drained", otherwise as
"Being Drained".
2019-02-19 10:06:37 +02:00
f1dcc4ac98 MXS-2304 Remove config_get_value()
Replaced with other functions.
2019-02-18 11:34:15 +02:00
f91a8813ea Reject "passwd" in monitor and service configs
Was deprecated in 2.3.
2019-02-18 11:34:15 +02:00
35460923b1 Replace "passwd" with "password" in system test configs 2019-02-15 11:27:07 +02:00
90e5b80b71 MXS-2050 Use global counter to detect log rotation request
Modules need to check the number regularly to detect a new log rotation.
2019-02-15 11:08:14 +02:00
98a081f65b MXS-2050 Separate session log and shared log handling
Shared log file is accessed under a lock.
2019-02-15 11:08:14 +02:00
25a53a649a MXS-2304 Remove config_get_param()
Replaced with other functions. Also removed password deprecation check.
2019-02-15 10:48:19 +02:00
1fd4ad64f6 MXS-2333 Add Clustrix monitor tutorial 2019-02-15 09:30:06 +02:00
21d9ec34cf MXS-2330 Use simpler queries
Since the current node id can be obtained using the function gtmnid()
the queries for finding out whether a node is in the quorum and whether
it is softfailed can be made simpler.
2019-02-15 08:09:03 +02:00
5c34550b40 MXS-2330 Do not use softfailed node as hub
When a softfailed node is finally revoked, it will appear as the
single node in a functioning Clustrix cluster. To ensure that the
Clustrix monitor will not stick to that node, if the node that is
used as hub is softfailed, it is immediately replaced with another
node.
2019-02-15 08:09:03 +02:00
35e17d9878 Disable server config serialization test
The config parameter ordering depends on which end of the linked list the
parameters are added. The test should be re-enabled once parameter handling
has been refactored.
2019-02-14 15:39:37 +02:00
1fed465fdb MXS-2246 Remove duplicate info in SERVICE and Service
Both of them contained fields for the service and router names.
Now the names are in SERVICE and they must be accessed via member
function.
2019-02-14 15:24:10 +02:00
2528c5fa4d MXS-2253 Make Cache use the new duration config type
Internally the Cache used seconds, so some changes were needed.
2019-02-14 10:57:55 +02:00
c116452c25 MXS-2253 Add MXS_MODULE_PARAM_DURATION
Added a new module parameter type to be used for parameters
that specify a duration. With the suffixes 'h', 'm', 's' and
'ms' the duration can be specified in hours, minutes, seconds
or milliseconds, respectively.

Irrespective of how the duration is specified, it is always
returned as milliseconds.

For backward compatibility, when a duration value is read it must
be specifed how a value *not* defined using a suffix should be
interpreted; as seconds or milliseconds.

  value = param->get_duration(name, mxs::config::INTERPRET_AS_SECONDS);
2019-02-14 10:57:55 +02:00
a0d715a39f MXS-2253 Update general documentation regarding durations 2019-02-14 10:57:55 +02:00
49c6244245 Update MaxCtrl and REST API dependencies 2019-02-13 13:54:56 +02:00
12c22f0ba8 Merge branch '2.3' into develop 2019-02-13 13:37:50 +02:00
d44193bc9e Merge branch '2.2' into 2.3 2019-02-13 13:37:42 +02:00
79fd01d4dd Add hintfilter to documentation contents 2019-02-13 13:37:02 +02:00
9a12ae53f2 Merge branch '2.3' into develop 2019-02-13 13:35:07 +02:00
77dc5946c7 Fix watchdog test
The test needs to remove the expected core dump to prevent the test from
failing.
2019-02-13 13:34:48 +02:00
36e64aefe8 MXS-2326: Add hint cloning test case
The test checks that the steps taken to reproduce the bug no longer result
in a failure to route the query correctly.
2019-02-13 13:34:48 +02:00
775fc043c8 MXS-2326: Clone routing hints on gwbuf_clone
When a buffer is cloned the hints for that buffer should also be cloned.
2019-02-13 13:34:48 +02:00
19143e04e1 Fix nested lists
Adding some spaces should fix rendering issues in KB.
2019-02-13 10:50:53 +02:00
311704cdd9 MXS-2050 Clean up session log checking
Also moved constants around.
2019-02-13 10:36:36 +02:00