Commit Graph

13128 Commits

Author SHA1 Message Date
b180c346d9 Make filter parameters a part of the definition
The filter parameters are now a part of the filter definition.
2019-03-26 13:44:04 +02:00
fd39291542 Don't indent extern "C" blocks 2019-03-26 13:44:04 +02:00
f8bc6b18fc Only add tasks once in binlogrouter
Adding the same task twice isn't allowed. The API of the housekeeper tasks
might have to be changed in a way that makes it possible for the caller to
know whether a task has been added.
2019-03-26 13:44:04 +02:00
0915487329 Pass std::string to add/remove task
By passing strings instead of const char pointers to the task control
functions, we can safely make copies of them knowing that the contents
won't disappear.
2019-03-26 13:44:04 +02:00
f0756cd708 Queue addition of housekeeper tasks
This fixes the hang on startup when binlogrouter calls hktask_add.
2019-03-25 19:21:12 +02:00
1e4c5f5d2f Remove housekeeper.cc
It is no longer used.
2019-03-25 19:21:12 +02:00
2cbfe4fb8a Stop maxscale if it won't be restarted
This makes sure no MaxScales are running when the test is started.
2019-03-25 19:21:12 +02:00
e88b7f56f9 Match against default database of queries
If a query doesn't define a table, the default database wouldn't get
checked. To prevent this, it must be explicitly checked.
2019-03-25 18:49:25 +02:00
74c888316e Fix csmon version check
The version check still assumed that 1.1.7 has the required functionality.
2019-03-25 18:48:26 +02:00
45ba520057 Update csmon documentation
The required functionality for automatic "master" detection is in 1.2.
2019-03-25 18:48:26 +02:00
fe359593ba MXS-2407 Report database for SHOW TABLES FROM db
The database used in 'SHOW TABLES FROM db' is now available via
qc_get_database_names().
2019-03-25 17:02:36 +02:00
8b4961261f MXS-2403 Update documentation 2019-03-25 15:26:17 +02:00
3c7e64181b MXS-2403 Check only what is necessary
The amount of checking is minimized and what can be checked in one
go, is checked in one go.
2019-03-25 15:26:17 +02:00
f9f9599e74 MXS-2403 Reject if masked filed is used in subquery
There's some overlapping work being done now. To be cleanup up
in a subsequent commit.
2019-03-25 15:26:17 +02:00
8b329f7f33 MXS-2403 Add 'check_subqueries' parameter
Only documentation and parameter handling.
2019-03-25 15:26:17 +02:00
3870fac600 MXS-2402 MXS-2396 '*' should be blocked only if there are rules
If there are no rules for the current user, then '*' should be
allowed in UNIONS and when defining variables.
2019-03-25 15:24:35 +02:00
25f8931384 MXS-2402 Reject if masked field is referred to in UNION select
If the second or subsequent select of a UNION statement refers to
a field to be masked, then the statement must be rejected.
2019-03-25 15:24:35 +02:00
ca8350ae35 MXS-2402 Document and handle 'check_unions' parameter
Only parameter handling, no actual functionality.
2019-03-25 15:24:35 +02:00
f37340e9fd MXS-2397 Provide context information for fields
The query classifier now returns contextual information for a fields;
does it appear in the (right hand side) of a UNION or in a SUBQUERY.
2019-03-25 15:24:35 +02:00
bf5f80b13b Fix ClustrixMonitor
The cluster check can only be made after the monitor has been
started. If done when monitor is configured it will at startup
be done when services are not yet available and hence they will
not be populated with the dynamically discovered servers.
2019-03-25 13:56:39 +02:00
382ddf3ea1 Update bug673 to expect new behavior
Since whitespace in object names is now disallowed, the test must be
adjusted accordingly.
2019-03-25 12:37:11 +02:00
c70dc23211 Fix processing of path parameters
Instead of the first character of the string being compared to the value
the whole string was compared.
2019-03-25 12:37:11 +02:00
4880edd373 Fix removal of servers from monitors
The last server wasn't removed as the set of relationships was empty. In
addition to this, changes to relationships via the relations endpoint
wasn't reflected by the monitor parameters.
2019-03-25 12:37:11 +02:00
9bb5e12413 Fix monitor creation and alteration
If a monitor was created at runtime, it was missing some parameters that
were assumed to be always present. In addition to that, the parameters
weren't validated against the list of common and module parameters.

Since the monitors always reconstruct the server list, the new servers can
be stored as a parameter. To make this possible, the
server_relationship_to_parameter helper function is needed.

This commit fixes the MaxCtrl test suite failures but does not fix the
failures in the REST API test suite.
2019-03-25 12:37:11 +02:00
2f634264dc Merge branch '2.3' into develop 2019-03-22 13:39:52 +02:00
4c6306e363 Merge commit '5cdba97ec7ee7f1ef74249b952774adf1b111464' into develop 2019-03-22 13:25:58 +02:00
75c6ef2dc8 Fix mxs_json_error usage
The function takes printf style arguments which means the format string
must be a string constant.
2019-03-22 12:52:56 +02:00
fadbdc7514 Merge branch '2.2' into 2.3 2019-03-22 12:11:24 +02:00
5cdba97ec7 Merge commit '216eb904c557509ea5a3216e68e274df957ab807' into 2.3 2019-03-22 10:48:31 +02:00
c57682291f Add missing json_api.hh header
The json_api.hh was not renamed but removed.
2019-03-22 02:05:36 +02:00
114c172387 Fix examplefilter
It used the old configuration parameter code.
2019-03-21 18:39:40 +02:00
bf2d6673bc Merge branch '2.3' into develop 2019-03-21 18:23:27 +02:00
40df519be4 Never reactivate monitors
Reactivating monitors shouldn't be done as it's simpler to actually
destroy and create a new one. The performance of reactivation is
insignificant compared to the possible inconsistency problems it allows.
2019-03-21 18:19:10 +02:00
203bba0e1d Add support for multiple runtime error messages
Storing all the runtime errors makes it possible to return all of them
them via the REST API. MaxAdmin will still only show the latest error but
MaxCtrl will now show all errors if more than one error occurs.
2019-03-21 18:19:10 +02:00
74eeb64fba Don't close connections to servers being drained
The connections to servers being drained should not be closed like they
should be for servers in maintenance mode. The change in functionality
between 2.3 and develop caused the connections to be discarded if the
server was in either maintenance or drain mode.
2019-03-21 18:19:10 +02:00
8ed192892a Make worker-local data lookups faster
By using a std::vector to store the keys, the cost of key lookup goes down
in comparison with std::unordered_map. The downside is the increase in
memory use in certain situations but given the fact that the intended
purpose of worker-local data is to store global data, this is unlikely to
have observable negative side-effects. Depending on the implementations of
std::vector and std::unordered_map, the use of std::vector could even
result in a smaller memory footprint.
2019-03-21 18:19:10 +02:00
494a8a660a Improve RoutingWorker utilities
Added an overload to execute_concurrently that takes an std::function as a
parameter and added a const version of operator* for rworker_local. Also
removed the std::move of the return value in rworker_local::values as it
can prevent RVO from taking place.
2019-03-21 18:19:09 +02:00
0130bc16e2 Fix monitor alteration
Alterations to monitors are now done with all changes present in the first
call to configure. This fixes the case where two parameters depended on
each other and one would get configured before the other.
2019-03-21 18:19:09 +02:00
60917238c3 Format config.cc and config_runtime.cc 2019-03-21 18:19:09 +02:00
be13cbc751 Fix parameter declaration formatting
Uncrustify always forced insertion of tabs which led to mangled formatting
of the parameters. Placing each part on a separate line seems to work
better and produce a more readable output.
2019-03-21 18:19:09 +02:00
c2fc80f122 Fix monitor creation
When the monitor was created, no parameters were passed to it.
2019-03-21 18:19:09 +02:00
0f1bc60431 Fix masking and dwfwfilter compilation
The filters were broken by the merge.
2019-03-21 18:18:33 +02:00
9bc721afb6 Merge commit '11ee74bad327e7fb15e8388d20e7838b9e49cadf' into 2.3 2019-03-21 17:52:42 +02:00
3448a36b68 Fix runtime config error generation
The error string was passed as the format string.
2019-03-21 17:48:47 +02:00
9236ace077 MXS-2355 If client is using the wrong authenticator, attempt a switch
Some SQL clients may default to a different authentication plugin than
"mysql_native_password". Since this is the only one supported by MySQL-
authenticator, the client is instructed to swap its plugin.
2019-03-21 17:07:09 +02:00
216eb904c5 MXS-1991 Allow replication_user and replication_password be set runtime
Because runtime changes are performed one at a time, adding replication credentials
to a mariadbmon which didn't have any would cause an error to be printed, and
the monitor would not start.

This is now fixed by allowing replication_user without replication_password. This
is not an ideal solution as a configuration file with only replication_user would be
accepted. Also, when adding the credentials to a monitor, replication_user must be
given first to avoid the error.
2019-03-21 17:06:24 +02:00
559b786533 MXS-2398 Handle MariaDB specific comments
Same approach as with regular comments:
- /*M! STMT */ are always parsed.
- /*M!###### STMT */ are never parsed.
2019-03-21 14:57:24 +02:00
11ee74bad3 Free the readwritesplit query queue
If the queue isn't empty when the session closes, the queue would leak.
2019-03-21 11:22:40 +02:00
2c4228db47 MXS-2400 Extend examplefilter
Added more comments. Also the filter now demonstrates how to
1) read configuration parameters
2) react to queries and replies
3) handle shared filter data
4) print diagnostics output
5) add log entries

As the filter is already built and moved to the library directory,
it is immediately usable. This should be helpful with assignments.
2019-03-21 11:02:16 +02:00
2ba7e63e7e Merge branch '2.3' into develop 2019-03-21 09:26:06 +02:00