Commit Graph

8965 Commits

Author SHA1 Message Date
d632c195ff 2.4.19 Update change date 2022-01-04 15:47:38 +02:00
3a05c22269 MXS-3892: Handle multiple pending queries
If the client sends another query before reading the previous result, it
was possible that another session finished the shard update and the
following query would reuse this result. This would cause the assertion in
the delayed call to fail as it assumes the shard would always be empty
when it was being called. To correctly handle this case, the delayed call
must be the one that moves the session into the normal routing state.
2021-12-31 15:33:15 +02:00
56ea0db3e6 MXS-3892: Delay routing instead of canceling it
Putting the sessions that aren't doing the update on hold makes the new
mechanism work the same way the old one did with the exception that it
won't put any extra work on the database itself.
2021-12-31 15:25:18 +02:00
41c2a6ee8e MXS-3892: Limit concurrent mapping of databases
As there are no practical benefits to multiple sessions for the same user
mapping the databases at the same time, limiting them to one update per
user is sensible. This is especially true now that we know the
information_schema tables aren't the most efficient things in the world.

The current code implements this rate limiting by closing any extra
sessions that would start a second update. The final implementation should
suspend them for the duration of the update as it is far more
user-friendly.

The limits are currently global as the shard caches are also global. This
is a performance bottleneck and it could be solved by storing the shard
cache inside of a mxs::WorkerGlobal instead of having it as a global
cache.
2021-12-31 15:25:18 +02:00
d57de28199 Fix schemarouter query queue
If the schemarouter service used a filter, any queued queries would end up
being routed twice for them as well. This would break any filters that
would expect a result for each query and it could also cause a hang if the
filter did not forward it up to the router.

The correct thing to do is to call the routeQuery method of the router
directly.
2021-12-31 15:25:18 +02:00
01dbcd8372 MXS-3915: Never cache autocommit queries
As both `SET autocommit=1` and `SET autocommit=0` share the same canonical
query form but do not have the same types, they should not be stored in
the cache.
2021-12-14 16:34:50 +02:00
e9da486c95 MXS-3885: Fix loading of configs from directories
The global config handler should only be used for the persisted
maxscale.cnf file, not for all files named maxscale.cnf.
2021-11-19 07:18:21 +02:00
e087a327fb MXS-3879: Fix loading of persisted global options
The code is now identical to the one in 2.5 and it still suffers from the
problem described in MXS-3885. This will be fixed in a separate commit.

This commit changes the persisted filename but since it was ignored, it
won't affect old installations.
2021-11-18 11:42:13 +02:00
1b432c1bf3 MXS-3617: Fix lost packets during writeq throttling
Backported the fix for MXS-3617 to 2.4.

If a packet was read from the backend while the client DCB was being
throttled due to writeq_high_water being hit, the response would be
discarded as it did not qualify for routing. The check should not check
whether the client DCB is in epoll as it has no effect on writes.
2021-11-10 07:27:37 +02:00
2a54224927 2.4.18 Update change date 2021-10-29 08:29:51 +03:00
0bf5641d80 MXS-3800: Explain lost_slave events
Currently the state change explanations are only added to mariadbmon. They
are less relevant for Galera clusters as they themselves explain why they
change their states but should still be added to make them easier to
analyze.

The event that isn't explained and is most often encountered is the loss
of a Slave status. Most often the loss of a Slave status happens because
either the IO thread or the SQL thread has stopped. Printing the states of
the threads as well as the latest error should hint at what caused the
outage.

The information can be added to the REST API in 2.5 where the monitors can
add extra information to the server JSON.
2021-10-20 10:03:03 +03:00
136d0271df Log DCB remote on SSL error
This should help identify the client which caused the error to occur.
2021-10-05 13:12:49 +03:00
b4edc74926 MXS-3609: Use 64-bit integers for statistics
This should be enough to avoid the problem of integer overflow in 2.4.
2021-08-31 08:15:02 +03:00
aa6a1a58eb MXS-3359 Change qla-filter append option to default to true
Append to log files after a restart rather than overwrite.
2021-08-20 13:03:13 +03:00
8765eb88fa MXS-3415: Export config with correct permissions
The created file is now created with the correct permissions: read and
write permissions for the user and group.
2021-08-02 09:30:06 +03:00
a1b3dfff54 MXS-3114: Fix creation of listeners with sockets
Backporting to 2.4.

The socket parameter wasn't correctly extracted.
2021-06-12 01:12:30 +03:00
784cab2daf MXS-3114: Fix duplicate listener check
Backporting to 2.4.

The listener search used the host and port for listeners that used sockets
and vice versa. This caused multiple listeners with sockets to fail to be
created.
2021-06-12 01:12:21 +03:00
2d9ebbdbc4 Merge branch '2.3' into 2.4 2021-06-07 08:34:26 +03:00
946f2e57fa MXS-3582: Backport fix to 2.3 and 2.4
2.3 and 2.4 seem to also be affected by it.
2021-06-04 14:06:25 +03:00
94b65f8242 MXS-3533: Advertise SESSION_TRACK capability
MaxScale already enables it explicitly in the flags in certain cases but
it didn't support it if the client asked for it.
2021-05-05 11:42:53 +03:00
38cdade698 MXS-3487: Close old master connection
When a transaction migration starts, the old master must be
unconditionally closed. This is the simplest way of resetting the
connection state and it also helps close unused connections.
2021-04-09 08:49:40 +03:00
a8bfbbe254 2.4.17 Update change date 2021-03-08 09:03:02 +02:00
e3c9f1544a Backport fix for MXS-3392 to 2.4
This solves problems with connectors that unconditionally send a
COM_STMT_PREPARE.
2021-03-04 11:14:44 +02:00
19066ae383 MXS-3425: Fix handling of LOAD DATA LOCAL INFILE
The LOAD DATA LOCAL INFILE is handled in a way where it returns two
results that both are complete: the first one with the file being
requested and the second one with the final OK packet. Readwritesplit
called session_book_server_response for both statements which caused the
current query index to drop to -1 which in turn was unconditionally used
as the buffer offset.

The new check for the invalid index value will help prevent crashes in
production while still allowing it to be detected while testing.
2021-03-03 11:02:15 +02:00
8df55ca913 Merge branch '2.4.16' into 2.4 2021-02-17 13:49:29 +02:00
3e7b8fcdc6 Fix get_canonical bug in treating decimal numbers
"select 1.", became "select 1.", should be "select ?"
2021-02-17 11:53:36 +02:00
0224f24077 2.4.16 Update Change Date 2021-02-16 14:59:00 +02:00
3620db9b0a Ignore the default value of connector_plugindir
The default value isn't a valid path and should be changed later on.
2021-02-11 16:43:00 +02:00
e48c5d11fc MXS-3345: Create persistdir earlier
The directory was created when the configuration was being processed and
it wasn't checked unless it was configured to a non-default value. With
the addition of the path validation, the directory must be created
earlier.
2021-02-10 15:05:40 +02:00
2657cc100e MXS-3330: Book only expected responses
Responses generated by replayed session commands must not be treated as
actual responses to retained statements. In 2.5 this is not a problem as
it is done implicitly with the pre-assignment of the server that delivers
the session command response.
2021-02-10 09:42:12 +02:00
47bcb6ad02 MXS-3345: Defer path permission checks
Doing the directory permission checks after all the values have been set
helps avoid problems with intermediate values that aren't valid. This
happens when --basedir generates invalid derived paths and the correct path
is provided as an argument right after it.

The path parameter is read from the configuration file only if it hasn't
been modified by a command line option. The case where an invalid command
line option is given but a valid configuration parameter would override it
is still treated as an error.

Also added a clarifying comment into set_dirs to make sure the handling
for the two path parameters is not moved inside set_runtime_dirs.

Fixed the testing scripts for the REST API and MaxCtrl now that the
directory permission checks are done correctly. Previously some paths seem
to have been ignored.
2021-02-09 17:36:41 +02:00
fac3ff4366 MXS-3346: Fix tarball plugin directory
The plugin directory wasn't installed and using --basedir with a path to
the extracted tarball wouldn't be enough.
2021-01-19 14:32:12 +02:00
dd340f9ec8 MXS-3346: Fix --basedir write permission checks
The connector plugindir required write access when it doesn't need it.
2021-01-19 14:32:11 +02:00
c5bcf7a8b1 2.4.15 Update change date 2021-01-18 15:30:30 +02:00
26d2c2387f Fix monitor connection error messages
The connection is closed by the ping_or_connect_to_db function which
causes the information about why the connection failed to be lost.
2021-01-18 12:02:40 +02:00
7e6eb55618 MXS-3324 Enable autocommit when using Connector-C
May solve some monitor issues on servers with default autocommit
set to off.
2020-12-17 13:37:30 +02:00
0c904eae5e MXS-3158 Preserve character set and collation when altering events
During switchover/failover, server events are altered. The ALTER
EVENT command automatically modifies the event charset and collation
to the values of the connetion running the query. This may cause
the event to become invalid.

Fixed this by changing connection charset and collation to the ones
in the event description just before altering it.
2020-12-14 14:06:43 +02:00
ce85a7292f Merge branch '2.3' into 2.4 2020-12-14 12:08:52 +02:00
d869dd358e MXS-3337: Select lowercase variable names
The current code assumes that the variable names are in lowercase. This
fixes the galera monitoring that was broken by commit
43068d20b43a34d5f3b4b4db0fcce701b3cd7cad. In addition, lowercase names
also helps when comparisons are done with std::string.
2020-12-11 18:37:05 +02:00
27a43fdf9d Merge branch '2.3' into 2.4 2020-12-11 16:38:43 +02:00
43068d20b4 MXS-3337: Fix galeramon query
The query now properly queries over both the status and the variables.
2020-12-10 11:56:07 +02:00
1d600a4f10 Merge branch '2.3' into 2.4 2020-12-01 10:11:56 +02:00
74a2ae727e Fix REST API startup error
The error generated by the library seems to use the port argument even if
a sockaddr argument is given.
2020-12-01 09:58:58 +02:00
6c160a3529 Log query classification info for session_trace
This fixes the bug where the detailed query classification info was only
logged when LOG_INFO was globally enabled.
2020-11-23 13:13:19 +02:00
5906f59344 Merge branch '2.4' into 2.4.14 2020-11-19 13:54:55 +02:00
56575882d7 MXS-3301 Rename clustrix -> xpand everywhere 2020-11-19 13:44:06 +02:00
47e1c04d09 MXS-3301 Look for "xpand" to find out whether server is Xpand
We will continue to look for "clustrix" as well so that MaxScale
will continue to work with older releases.
2020-11-19 13:43:30 +02:00
5fc73646a4 MXS-3301 Rename clustrix -> xpand everywhere 2020-11-18 10:02:02 +02:00
9ed51b69e1 MXS-3301 Look for "xpand" to find out whether server is Xpand
We will continue to look for "clustrix" as well so that MaxScale
will continue to work with older releases.
2020-11-17 17:30:50 +02:00
64ca695c84 Revert "MXS-3301 Look for "xpand" to find out whether server is Xpand"
This reverts commit 4728730510409fc15d2b3a55fa6e00008651794d.

The clustrix -> xpand name change causes too much trouble when merging
to 2.5.
2020-11-17 17:21:14 +02:00