Commit Graph

2968 Commits

Author SHA1 Message Date
bcf26fba3e Add missing COMMIT detection for non-transactional engines
Non-transactional engines will use a query event with a COMMIT in it to
signal that the transaction is over.
2019-09-30 11:45:01 +03:00
51d2d6c1f2 Fix GTID file path generation
The path would be invalid if there was no trailing slash.
2019-09-30 11:45:01 +03:00
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
bd3107e7ca Merge branch '2.3' into 2.4 2019-09-19 15:37:43 +03:00
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
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
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
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
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
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
0bb53bf411 Merge branch '2.3' into 2.4 2019-08-29 02:00:16 +03:00
7a1abc26d8 MXS-2631 Fix the ignoring of the system tables 2019-08-29 01:00:49 +03:00
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
bf551c5b1e Merge branch '2.3' into 2.4 2019-08-09 03:01:00 +03:00
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
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
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
27f11df700 Merge branch '2.3' into 2.4 2019-08-08 08:07:59 +03:00
fd72332ea4 Improve master failure error message
The message will now always contain the server name.
2019-08-05 12:48:19 +03:00
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
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
4503f02adb Merge branch '2.3' into 2.4 2019-07-29 15:52:22 +03:00
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
a9b01ff4cc Merge branch '2.3' into 2.4 2019-07-28 21:43:58 +03:00
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
b07ffdb2fa Fix hang on transaction replay
The expected response counter was not decremented if a transaction replay
was started. This caused the connections to hang which in turn caused the
failure of the mxs1507_trx_stress test case.
2019-07-26 09:34:08 +03:00
f31f09fc66 Don't print errors with master_failure_mode=error_on_write
The errors are expeted and should not be logged.
2019-07-23 14:12:58 +03:00
12bd26398f MXS-2486: Add missing schemarouter capabilities
The capabilities that the schemarouter declared were missing the
RCAP_TYPE_PACKET_OUTPUT which caused partial packets to be returned to it.
2019-07-23 09:57:53 +03:00
fbeb5d9c84 Always ignore server-internal databases
The mysql, information_schema and performance_schema databases should
always be ignored if found on multiple servers.
2019-07-23 09:38:29 +03:00
835049d506 Merge branch '2.3' into 2.4 2019-07-19 12:25:26 +03:00
1ddcbc9ae1 Log error message on slave session command failure
If the slave's response differs from the master and the slave sent an
error packet, log the contents of the error. This should make it obvious
as to what caused the failure.
2019-07-18 17:58:22 +03:00
2e70e2bc93 Merge branch '2.3' into 2.4 2019-07-18 12:49:00 +03:00
84f4688ebb Fix readwritesplit response count assertion
The assertion in routeQuery that expects there to be at least one ongoing
query would be triggered if a query was received after a master had failed
but before the session would close. To make sure the internal logic stays
consistent, the error handler should only decrement the expected response
count if the session can continue.
2019-07-18 12:24:06 +03:00
3649efde0b MXS-2605: Remove false debug assertion
The assertion doesn't count executed session commands and thus is not
reliable.
2019-07-16 21:45:36 +03:00
5b3c0b8b81 Merge branch '2.3' into 2.4 2019-07-16 13:17:35 +03:00
21dfcb5648 Fix COM_STMT_LONG_DATA routing
The initial COM_STMT_LONG_DATA would not trigger the "pinning" of the
statement to a known node.
2019-07-10 11:06:51 +03:00
f9b1a0a0c4 Merge branch '2.3' into 2.4 2019-07-10 08:17:34 +03:00
e516c11ac5 MXS-2587: Never route stored queries in routeQuery
This could end up in infinite mutual recursion if no responses are
expected. Although this does not happen now that MXS-2587 is fixed, the
code should not even be there.
2019-07-05 14:19:44 +03:00
0261b65529 Fix avrorouter parameters
The two new parameters weren't documented and `server_id` used the wrong
type.
2019-07-05 14:12:59 +03:00
6a1ef9d21e Remove declared but not defined methods
Readwritesplit still declared the old methods used to update the
configuration data.
2019-07-05 13:56:17 +03:00
8960d2df8f Merge branch '2.3' into 2.4 2019-07-04 09:39:52 +03:00
953dd4098b MXS-2587: Prevent queries after failed trx replay
If a transaction replay fails, no queries must be routed before the
connection is closed. This could happen if the client received the error
from the replay failure and closes the connection before the fake hangup
generated by the replay failure is processed.
2019-07-04 08:21:16 +03:00
3e85500491 Merge branch '2.3' into 2.4 2019-07-02 08:38:15 +03:00
4954c7f6b7 Fix sending of unknown PS error
The error was only generated for COM_STMT_EXECUTE commands when all PS
commands should trigger it. In addition, large packets would get sent two
errors upon the arrival of the trailing end.
2019-07-01 10:25:41 +03:00
3b6387c952 MXS-2562: Stop immediately on mid-resultset failure
If a server fails mid-resultset, there's not a lot we can do to recover
the situation. A few cases could be handled (e.g. generate an ERR if the
resultset has proceeded to the row processing stage) but these fall
outside the scope of the original issue.
2019-06-28 20:25:31 +03:00
5dca53f877 Merge branch '2.4.0' into 2.4 2019-06-28 17:58:01 +03:00
fcc19f3c66 Merge branch '2.3' into 2.4 2019-06-27 08:53:33 +03:00
5eba688c1b MXS-2521: Detect COM_STMT_EXECUTE without metadata
If a COM_STMT_EXECUTE has no metadata in it and it has more than one
parameter, it must be routed to the same backend where the previous
COM_STMT_EXECUTE with the same ID was routed to. This prevents MDEV-19811
that is triggered by MaxScale routing the queries to different backends.
2019-06-27 08:29:30 +03:00
d45915c279 Treat empty avro filenames as an error
If an empty filename is requested, treat it as an error.
2019-06-26 10:17:21 +03:00
01822490ca Fix avrorouter and cluster usage
The servers defined by `cluster` wouldn't get used.
2019-06-26 10:17:21 +03:00