Commit Graph

7730 Commits

Author SHA1 Message Date
a4c6f3542a MXS-2315: Tokenized CS version extraction
The STL regex implementations have proven to be unreliable on older
systems and replacing the regex with hand-written code for version
extraction is less prone to break.
2019-04-17 11:17:33 +03:00
fb785d1afc Merge branch '2.3.6' into 2.3 2019-04-17 11:17:13 +03:00
d3bfe0a712 Fix handling of large result packets
The RWBackend didn't know to skip the tail end of large packets.
2019-04-17 11:16:16 +03:00
2ca9337da1 Merge branch '2.2' into 2.3 2019-04-16 16:34:57 +03:00
5ba305c2c1 MXS-2426 Do not permanently disable automatic cluster operations when they fail
Only disabled for "failcount" monitor ticks. Also turns some related log
messages to notices.
2019-04-16 11:26:34 +03:00
f8a22d0ac0 MXS-2344 Add setting for enabling SSL for replication
If the monitor setting "replication_master_ssl" is set to on, any CHANGE MASTER TO-command
will have MASTER_SSL=1. If set to off or unset, MASTER_SSL is left unchanged to match existing
behaviour.
2019-04-15 19:15:45 +03:00
bd54efbb3f Fix skip_encoded_int
A single byte integer wasn't skipped.
2019-04-15 12:18:30 +03:00
f6bd9fefa4 Move assertion after error message
Logging the internal state before the assertion makes it easier to figure
out why the assertion failed in the first place.
2019-04-15 12:07:48 +03:00
b3399dccc4 Remove useless templates from RWBackend functions
There's no need for templates as the code is only used with one
type. Changed the code to use std::advance as that might avoid a copy of
the iterator.
2019-04-12 16:31:43 +03:00
1652b18a7b Fix whitespace in canonicalized queries
Trailing whitespace was not removed and whitespace wasn't normalized to
spaces.
2019-04-12 09:18:07 +03:00
d2ecaa83a6 Move result start handling into separate function
The largest part of the code deals with the start of a response. Moving
this into a subfunction makes the function clearer as the switch statement
inside a switch statement is removed.
2019-04-12 09:18:07 +03:00
746bd53668 Simplify RWBackend result handling
By processing the packets one at a time, the reply state is updated
correctly regardless of how many packets are received. This removes the
need for the clunky code that used modutil_count_signal_packets to detect
the end of the result set.
2019-04-12 09:18:05 +03:00
e6526dd9ea Add extra info logging to readwritesplit
Added logging into RWBackend reply state processing code to know more.
2019-04-12 09:17:48 +03:00
9a5b60a071 Add forced maintenance mode tests
Tested that the force option works and is accepted.
2019-04-09 10:00:50 +03:00
0cb15976e8 Backport: Add force option to set endpoint
The new `force=yes` option closes all connections to the server that is
being put into maintenance mode. This will immediately close all open
connections to the server without allowing results to return.
2019-04-09 09:43:18 +03:00
7fb840ac9e Sort CN_ definitions 2019-04-09 09:43:18 +03:00
05515cca16 MXS-2259: Limit size of client reads
Given the assumption that queries are rarely 16MB long and that
realistically the only time that happens is during a large dump of data,
we can limit the size of a single read to at most one MariaDB/MySQL packet
at a time. This change allows the network throttling to engage a lot
sooner and reduces the maximum overshoot of throtting to 16MB.
2019-04-05 22:48:16 +03:00
aad29404c6 Fix parameter value error
The argumets were given in the wrong order.
2019-04-05 13:33:16 +03:00
b54e67223f MXS-2423: Add missing parameters to maxscale endpoint
Also updated the REST API documentation to include the newer output
(automating this update would be valuable).
2019-04-05 13:33:16 +03:00
9722c0887a Log connection ID when reading server handshake
By logging the connection ID for each created connection, failures can be
traced back from the backend server all the way up to the client
application.
2019-04-05 13:33:16 +03:00
ec890b33cd Prevent checksum mismatch on second trx replay
If a transaction replay has to be executed twice due to a failure of the
original candidate master, the query queue could contain replayed
queries. The replayed queries would be placed into the queue if a new
connection needs to be created before the transaction replay can start.
2019-04-05 13:33:16 +03:00
6421af1bb4 Backport query queue changes to 2.3
Backported the changes that convert the query queue in readwritesplit into
a proper queue. This changes combines both
5e3198f8313b7bb33df386eb35986bfae1db94a3 and
6042a53cb31046b1100743723567906c5d8208e2 into one commit.
2019-04-05 13:33:16 +03:00
b08d4e37b5 MXS-2416: Pass deleter to std::shared_ptr<GWBUF>
As shared_ptr doesn't automatically use std::default_delete<T>, it needs
to be explicitly passed to the constructor.
2019-04-03 12:57:06 +03:00
e3e66f8e90 MXS-2417: Add option to ignore persisted configs
The load_persisted_configs parameter now controls whether persisted
runtime changes are loaded on startup. The changes are still generated as
it persists the current state of MaxScale making problem analysis easier.
2019-04-03 12:57:05 +03:00
a217dde1f0 MXS-2419: Queue queries executed during trx replay
By storing the queries in the query queue and routing it once the
transaction replay is done, we prevent two problems:

* Multiple transaction replays would overwrite the m_interrupted_query
  buffer that was used to store any queries executed during the
  transaction replay.

* Incorrect ordering of queries when the query queue is not empty and a
  new query is executed during transaction replay.
2019-04-03 12:57:05 +03:00
2dfd7d35ac MXS-2418: Crash on trx replay when log_info is enabled
If the session starts with no master but later one becomes available, when
a transaction is started the code would unconditionally use the master's
name in a log message.
2019-04-03 12:57:05 +03:00
738ae9178b Fix binlogfilter matching
The matching always checked the default database when it should only check
it if there are no tables in the statement.
2019-04-01 11:29:16 +03:00
5346b24fa4 MXS-2393 Add parameter 'require_fully_parsed'
If set to true and if any of the other blocking related parameters
is true, then a statement that cannot be fully parsed will be blocked.

Default is true.
2019-04-01 10:52:52 +03:00
48791c3877 Fix duplication of the router parameter
The service parameter list had two router entries in it due to the
assumption that the parameter list never contained the router itself in
it.
2019-03-29 10:35:41 +02:00
116efb2409 MXS-2379: Fix maxinfo HTTP interface
Added the missing HTTP request handlers and a new JSON conversion
function.
2019-03-28 14:03:56 +02:00
0fa7ad8580 Remove excessive memory allocation from dcb_printf
The function allocated a constant-sized chunk of memory for all messages
which was excessive as well as potentially dangerous when used with large
strings.
2019-03-28 14:03:56 +02:00
c4b82b7d83 MXS-2359 Route statements with database but no table dependence
Queries such as SHOW TABLES FROM db1 are now routed to the backend with db1.
This gives the correct result as long as db1 is not sharded to multiple
backends.
2019-03-27 13:46:36 +02:00
ee88180c54 MXS-2409 Check that prepared statement exists
If the PREPARE is malformed, the extracted statement is null.
2019-03-27 13:46:36 +02:00
a78f0fbe25 Merge branch '2.2' into 2.3 2019-03-27 12:16:54 +02:00
04f70879d2 MXS-2410: Uniquely identify DCBs
The address alone doesn't guarantee validity of a DCB.
2019-03-27 11:58:31 +02:00
c6272594d6 MXS-2359 Remove special handling for SHOW TABLES
The code only handled the basic version of the command, returning incorrect
results if modifiers were used. The code is now removed, causing the command
to be routed to the backend of the current database. This will give correct
results as long as that backend contains all the tables of the database e.g.
no table sharding.
2019-03-27 10:30:29 +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
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
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
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