8635 Commits

Author SHA1 Message Date
Markus Mäkelä
f9a6649d77
Merge branch '2.3' into 2.4 2019-09-24 21:42:32 +03:00
Markus Mäkelä
fcc7642328
MXS-2694: Add support for COM_BINLOG_DUMP
The resultset processing now understands COM_BINLOG_DUMP and treats it as
a never-ending resultset.
2019-09-24 21:41:24 +03:00
Markus Mäkelä
9ce788ff0b
MXS-2690: Fix duplicate database detection
Empty duplicate databases are now correctly detected since the results
will always return the database name combined with a trailing period.
2019-09-21 21:16:55 +03:00
Johan Wikman
19487d2bfb Merge branch '2.3' into 2.4 2019-09-20 09:36:23 +03:00
Johan Wikman
f587ec191d MXS-2688 Add QC operator QUERY_OP_SET
Allows RWS to unconditionally send all SET-statements to
all servers.
2019-09-20 09:27:38 +03:00
Markus Mäkelä
bd3107e7ca
Merge branch '2.3' into 2.4 2019-09-19 15:37:43 +03:00
Markus Mäkelä
f46f873dc1
Add verbose backend status helper
This allows the same verbose information to be logged in the cases where
it is of use. Mostly this information can be used to figure out why a
certain session was closed.
2019-09-19 13:41:49 +03:00
Markus Mäkelä
fd0c156655
MXS-2564: Reconnect only when necessary
By doing the reconnection only when a new query arrives, we prevent the
excessive reconnecting that is done when a server's actual and monitored
states are in conflict.
2019-09-19 13:41:49 +03:00
Markus Mäkelä
40d05e8278
Report more details when the master is unavailable
By dumping the connection state we'll know when the connection was opened
and closed and the reason why it was closed.
2019-09-19 12:55:31 +03:00
Markus Mäkelä
f4a51e0b47
Fix split brain detection
Galeramon will now only use the larger cluster in case a split brain
situation occurs. If the clusters are of equal size, the one whose UUID
compares less will be used. This will guarantee that all MaxScales that
see the same picture will end up using the same cluster.
2019-09-18 16:43:12 +03:00
Esa Korhonen
78cc5b2445 Move packet_tracker.cc under maxscale
It depends on MaxScale-types. This also removes the maxsql-pcre2-dependency.
2019-09-18 12:19:09 +03:00
Johan Wikman
1f26189ddd Merge branch '2.3' into 2.4 2019-09-17 14:55:34 +03:00
Johan Wikman
dabab543cc MXS-2684 Add throttling callbacks to backend DCB from pool
Add throttling callbacks to a backend DCB taken from the persistent
pool. They were removed when the dcb was put into the pool.
2019-09-17 14:45:53 +03:00
Markus Mäkelä
31029eaec8
MXS-2675: Fix server creation with TLS via REST API
The TLS parameters were defined but the main parameter that enables it
wasn't automatically added. As the REST API documentation states that this
parameter does not need to be defined, the runtime configuration must add
it.
2019-09-13 14:14:34 +03:00
Esa Korhonen
ebbd806c6a Merge branch '2.3' into 2.4 2019-09-06 10:59:08 +03:00
Esa Korhonen
00feb61b23 MXS-2652 Do not clear maintenance flag when a server goes down
The set of flags to clear should be well-defined.
2019-09-06 09:43:32 +03:00
Esa Korhonen
6edbd52324 MXS-2642 Do not re-test a pam-service for a given user
Because of how the user-data was read, the same service name could be
found multiple times if the user-search query matched multiple rows. Now
the service names are read to a set, which ignores duplicates. The same
service may be attempted again if the authentication fails and user-data
is fetched again.
2019-09-04 17:31:10 +03:00
Markus Mäkelä
46a3c9f61c
Log interrupting packet's type during trx replay
This will allow non-SQL commands to be detected.
2019-09-04 15:40:52 +03:00
Esa Korhonen
68f3b235e1 MXS-2650 Fix SSL-use with Connector-C
Authenticators and monitors now use SSL when configured. The fix has two parts:
1) Removed the extra SSLConfig inside SSLProvider, as SSLContext already contains
the config.
2) When inputting parameter values to mysql_ssl_set(), empty strings are converted
to NULL-pointers as the function expects those for unused values.
2019-08-29 17:46:26 +03:00
Johan Wikman
5a7c68e3c9 MXS-2612 Ensure that destructor order does not matter
The new configuration system relieas upon static varibles being
used for declaring what arguments a particular module uses. To
ensure that the destruction order does not matter, we redundantly
store the needed data (the name).
2019-08-29 08:01:35 +03:00
Marko
0bb53bf411 Merge branch '2.3' into 2.4 2019-08-29 02:00:16 +03:00
Marko
7a1abc26d8 MXS-2631 Fix the ignoring of the system tables 2019-08-29 01:00:49 +03:00
Esa Korhonen
e6bf020b9e Continue name resolution fixing, add unit test
name_lookup() now returns all results given by getnameinfo(). When searching
for a server, finding one matching address in the lookup-results is enough for
a match.

Also, added a test for name_lookup(). The test is minimal on its own, as hardcoded
test cases are not generally valid.
2019-08-16 12:52:52 +03:00
Esa Korhonen
45ed3e085f Merge branch '2.3' into 2.4 2019-08-14 17:40:30 +03:00
Markus Mäkelä
16cc3cd64b
Fix negative expected response count on trx rollback
The expected reply count should only be decremented on success.
2019-08-14 14:50:34 +03:00
Esa Korhonen
72ce2d2bc1 MXS-2633 Fix PAM authentication support with server version 10.4
The new server pam plugin does not always send the first password prompt with the
AuthSwitchRequest-packet. In this case the server expects the client (MaxScale) to
just send the password immediately. MaxScale now checks the length of the packet,
sending the password if the packet is short. This works with both old and new server
versions.
2019-08-13 17:15:45 +03:00
Marko
8ce6a679be Merge branch '2.3' into 2.4 2019-08-09 19:44:46 +03:00
Marko
5899556d89 MXS-2592 Enable runtime configuration of session_trace 2019-08-09 19:36:24 +03:00
Markus Mäkelä
bf551c5b1e
Merge branch '2.3' into 2.4 2019-08-09 03:01:00 +03:00
Markus Mäkelä
1748e6599d
MXS-2609: Fix session command mixup on master failure
If a master failed during an ongoing session command history replay, it
would be treated as if a normal session command failed which would result
in the already executed session command being re-executed on all servers
at the wrong logical position.

To fix this, the history replay must be distinguished from normal session
command execution. When a connection replaying the history fails, the
query routing simply needs to be attempted again.
2019-08-09 01:54:09 +03:00
Markus Mäkelä
547236b7a4
MXS-2609: Store history size in Backend
When a connection is created, the size of the history that is about to be
replayed is known. Storing this and decrementing it each time a session
command is completed tells us when the Backend has finished replaying the
session command history. This can then be used to distinguish whether a
session command executed on a master should be retried or whether to
simply discard the connection.
2019-08-09 01:54:09 +03:00
Markus Mäkelä
8bc4e42f2d
Fix query queuing on session command execution
If session command execution during server reconnection caused a query to
be queued, the query would be put on the tail end of the queue. This would
cause queries to be reordered if the queue wasn't empty. The correct thing
to do would be to put the next pending query back at the front of the
queue.
2019-08-09 01:54:09 +03:00
Markus Mäkelä
bb6f9213d4
Fix debug assert on master reconnection
If a master reconnection occurred after the session command history was
disabled due to the limit being exceeded, a debug assertion would be hit
in prepare_target. This assert makes sure that a connection can be safely
created to the server which means that in release mode builds the session
state would be inconsistent on the new master.

As this is an unrecoverable situation, the session should stop immediately
even if delayed_retry is enabled. Currently the session will continue
until the delayed retry timeout is hit. This happens due to the fact that
the delayed retry mechanism handles all errors in a similar way.
2019-08-09 01:54:09 +03:00
Markus Mäkelä
9f6efef67a
MXS-2576: Update states atomically in csmon
This prevents false transient states from occurring.
2019-08-09 01:54:09 +03:00
Johan Wikman
27f11df700 Merge branch '2.3' into 2.4 2019-08-08 08:07:59 +03:00
Markus Mäkelä
d3e199ff1d
Use old default parameter definitions in config2.cc
This prevents problems when 2.3 is merged into 2.4 and it contains new
common parameters with defaults.
2019-08-05 15:06:25 +03:00
Markus Mäkelä
fd72332ea4
Improve master failure error message
The message will now always contain the server name.
2019-08-05 12:48:19 +03:00
Johan Wikman
01427e32ec Merge branch '2.3' into 2.4 2019-08-02 10:03:34 +03:00
Johan Wikman
110bc32b25 MXS-2621 Fix broken authorization SQL 2019-08-02 09:48:14 +03:00
Esa Korhonen
1514a77345 Improve main thread detection
Now properly checks if configuration and diagnostics functions are ran in either
main() or in the admin worker. This is useful for debugging and enforcing
thread safety.

Also, monitors are now started and stopped in the admin worker.
2019-07-31 12:36:05 +03:00
Markus Mäkelä
9d0c6b908a
MXS-2603: Treat WSREP errors as ignorable errors
When a query returns a WSREP error, most of the time it is not something
the client application is expecting. To prevent this from affecting the
client, it can be treated the same way a transaction rollback is treated:
ignore the error and try again.
2019-07-30 13:53:23 +03:00
Markus Mäkelä
45aa40c10a
Fix RWBackend state tracking with multi-result queries
If a query returned multiple resultsets and the connection was broken
between the resultsets, the backend would not know that parts of the
response were already sent. This is caused by the cyclic nature of the
state machine when multi-result responses are being processed.

To fix the problem, the result size is tracked to know how many bytes have
been sent to the client. This is a backport of the
MySQLProtocol::Result::size from 2.5(develop).
2019-07-30 13:53:23 +03:00
Johan Wikman
ed84f29fca MXS-2612 Free routing worker local data
When a RoutingWorker is destructed, all existing local data will
unconditionally be destroyed.

The case in point is the vector<SFilterDef>s that are held as routing
worker local data by the Service. Unless the local data is deleted, the
filter defs will not be deleted at shutdown.

This is somewhat brute-force (but good to have in place nonetheless) as
the deletion of the local data should be done by the Service and before
the routing worker thread has exited.
2019-07-30 13:01:12 +03:00
Johan Wikman
ee8042c40b MXS-2613 Access correct argument
The cache show-command accessed the wrong argument. That is why

    [maxadmin|maxctrl] call command cache show TheCache

did not work.
2019-07-30 13:00:37 +03:00
Johan Wikman
c592328ea2 MXS-2613 Access correct argument
The cache show-command accessed the wrong argument. That is why

    [maxadmin|maxctrl] call command cache show TheCache

did not work.
2019-07-30 12:29:01 +03:00
Marko
3940547cc2 Fix the name of the undefined rlag value
Older name was used due to merge from 2.3.
2019-07-29 22:27:16 +03:00
Marko
4503f02adb Merge branch '2.3' into 2.4 2019-07-29 15:52:22 +03:00
Markus Mäkelä
dda02b45ee
MXS-2520: Do master replacement if it's possible
This allows a new master to be chosen regardless of the target server
type.
2019-07-29 10:26:30 +03:00
Marko
a9b01ff4cc Merge branch '2.3' into 2.4 2019-07-28 21:43:58 +03:00
Marko
918a2964d5 MXS-2592 Add configuration for session specific in-memory log
When enabled each session will write log messages in the in-memory log.
If session ends in error this log is written to the actual log in disk.
2019-07-28 20:56:22 +03:00