13882 Commits

Author SHA1 Message Date
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
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
Marko
3ddcc49288 MXS-2592 Use the correct log level variable 2019-07-29 12:07:02 +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
Markus Mäkelä
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
Markus Mäkelä
9a7153dcec
Fix mysqlmon_multimaster
It failed to compile with a new-ish compiler as the output argument was
guaranteed to be null.
2019-07-26 09:10:47 +03:00
Markus Mäkelä
9171dbaad6
Replace trimEnd with trim
trimEnd was introduced in Node.js 10.0 which is not in the 6.0 version we
use.
2019-07-26 09:10:46 +03:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Esa Korhonen
d4b712ae84 MXS-2546 Add DNS-resolving to topology detection
When matching hostnames between MaxScale server configuration and the
SHOW SLAVE STATUS-output, use DNS-resolution if a simple string comparison
doesn't find an answer. Results of the resolution are saved to avoid
repeating the operation for the same address.
2019-07-22 11:10:23 +03:00
Esa Korhonen
5df1f2561c MXS-2546 Save master server to slave connection object
Simplifies later checks and removes duplicate code. The "assume_unique_hostnames"-
setting is no longer required within the MariaDBServer-class.
2019-07-19 17:10:10 +03:00
Esa Korhonen
2a1925744b MXS-2546 Separate slave connection settings to its own class
The settings are different from the other fields in that they should not change
on their own. Most manipulation functions only require the settings.

Also takes into use a class for host and port data.
2019-07-19 17:00:18 +03:00
Esa Korhonen
0257e6e690 MXS-2546 Remove external master tracking
It was only used for logging.
2019-07-19 16:39:03 +03:00
Markus Mäkelä
835049d506
Merge branch '2.3' into 2.4 2019-07-19 12:25:26 +03:00
Markus Mäkelä
8e23a6cdb9
MXS-2607: Remove trailing spaces in MaxCtrl --tvs mode
As the TSV format uses tabs as delimiters, the trailing spaces would
acutally be interpreted as data.
2019-07-19 12:16:04 +03:00
Markus Mäkelä
146b940245
Dump statements on fatal signal
This should make it easier to figure out what is going on at the time of
the crash if statement collection is enabled.
2019-07-19 12:03:36 +03:00
Markus Mäkelä
e3b1eebb15
Update unit test configs
Removed some of the useless parameters, tuned some values and reordered it
to declare objects before they are referred to.
2019-07-19 12:03:36 +03:00
Markus Mäkelä
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
Markus Mäkelä
2e70e2bc93
Merge branch '2.3' into 2.4 2019-07-18 12:49:00 +03:00
Markus Mäkelä
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
Markus Mäkelä
52fd2f011f
Use a fixed Connector-C version
The connectors should be built from a known release.
2019-07-17 16:26:48 +03:00
Markus Mäkelä
f8ee11cf55
MXS-2606: Sort servers before loading users
By sorting the servers in descending order based on their role we make
sure that the users are loaded from a master if one is available.
2019-07-17 14:42:32 +03:00
Markus Mäkelä
f139991a2c
MXS-2559: Log source of loaded users
MySQLAuth now logs the server where the users were loaded from. As only
the initial loading of users causes a log message, it is still possible
for the source server to change without any indication of it.
2019-07-17 10:23:48 +03:00
Markus Mäkelä
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
Markus Mäkelä
5b3c0b8b81
Merge branch '2.3' into 2.4 2019-07-16 13:17:35 +03:00
Markus Mäkelä
7e72f853a2
MXS-2601: Remove MaxAdmin from example config 2019-07-16 13:04:52 +03:00
Markus Mäkelä
c878d796be
Merge branch '2.2' into 2.3 2019-07-16 12:59:03 +03:00
Esa Korhonen
0996b9217a MXS-2544 Check roles in PAM authenticator
Also re-adds anonymous user support.
2019-07-16 11:36:11 +03:00
Esa Korhonen
d0e18b165a MXS-2544 Use separate sqlite tables for user authentication data
The data is now split into three tables similar to the server.
2019-07-16 10:59:15 +03:00
Esa Korhonen
f752f139ba MXS-2544 Add utility class for handling SQLite
Preparation and cleanup for adding more data to handle user roles in PAM
authenticator.
2019-07-16 10:58:47 +03:00
Markus Mäkelä
bc2f7f4040
MXS-2597: Log libmicrohttpd errors on startup
By enabling the debug messages only at startup, we'll get log messages for
any daemon startup failures and we exlude the verbose parsing errors that
malformed requests cause.
2019-07-16 10:03:27 +03:00
Markus Mäkelä
797069df52
Fix npm audit warnings
Updated lodash to a newer version.
2019-07-16 09:34:15 +03:00
wuzang.hdp
ee83a6ca0d fix memory leak on handling COM_CHANGE_USER 2019-07-12 11:52:23 +03:00
Markus Mäkelä
8c84a2b2a4
Fix error detection in service creation
If a server that did not exist was added to the service, the error would
not cause a startup failure.
2019-07-11 09:39:06 +03:00
Markus Mäkelä
0394c9c525
MXS-2449: Fix maxinfo monitor status output
The status use an AND operation when it should do an equality comparison.
2019-07-10 12:38:10 +03:00
Markus Mäkelä
3e686e0ba5
Extend stacktrace printing
There was a case that wasn't handled which would happen with
executables. Also removed the path truncation to show where the library
was loaded from.
2019-07-10 11:06:52 +03:00
Markus Mäkelä
9de06a52b0
Allow infinite refreshes of users
The hard limit of 10 seconds is too strict when taking into account the
fact that infinite refreshes was possible before the bug was fixed. This
also makes testing a lot easier where rapid reloads are necessary.
2019-07-10 11:06:52 +03:00
Markus Mäkelä
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
Markus Mäkelä
c280da003b
Merge branch '2.3' into 2.4 2019-07-10 09:30:04 +03:00
Markus Mäkelä
a91726100c
Merge branch '2.2' into 2.3 2019-07-10 09:09:24 +03:00
Markus Mäkelä
c7d90636b0
MXS-2594: Fix priority usage without node priorities
The first node without a priority would be chosen as the candidate master
and the rest would be ignored. The code must check if neither of the two
nodes have priorities and if so must choose the better one.
2019-07-10 09:06:27 +03:00
Markus Mäkelä
f9b1a0a0c4
Merge branch '2.3' into 2.4 2019-07-10 08:17:34 +03:00
Markus Mäkelä
8a176d64aa
MXS-2490: Add direct execution support
Certain MariaDB connectors will use the direct execution for batching
COM_STMT_PREPARE and COM_STMT_EXECUTE execution without waiting for the
COM_STMT_PREPARE to complete. In these cases the COM_STMT_EXECUTE (and
other COM_STMT commands as well) will use the special ID 0xffffffff. When
this is detected, it should be substituted with the ID of the latest
statement that was prepared.
2019-07-09 14:59:52 +03:00
Markus Mäkelä
5aa9daaeea
Improve stack trace printing
The stacktrace now removes leading paths from object files and common
source code prefixes. It also skips the first five frames which are always
inside the stacktrace printing code and the signal handler.
2019-07-09 10:56:08 +03:00