1184 Commits

Author SHA1 Message Date
Johan Wikman
d632c195ff 2.4.19 Update change date 2022-01-04 15:47:38 +02:00
Markus Mäkelä
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
Johan Wikman
2a54224927 2.4.18 Update change date 2021-10-29 08:29:51 +03:00
Markus Mäkelä
2d9ebbdbc4
Merge branch '2.3' into 2.4 2021-06-07 08:34:26 +03:00
Markus Mäkelä
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
Markus Mäkelä
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
Johan Wikman
a8bfbbe254 2.4.17 Update change date 2021-03-08 09:03:02 +02:00
Johan Wikman
0224f24077 2.4.16 Update Change Date 2021-02-16 14:59:00 +02:00
Johan Wikman
c5bcf7a8b1 2.4.15 Update change date 2021-01-18 15:30:30 +02:00
Johan Wikman
5906f59344 Merge branch '2.4' into 2.4.14 2020-11-19 13:54:55 +02:00
Markus Mäkelä
10582a02fe
Merge branch '2.3' into 2.4 2020-11-17 10:54:58 +02:00
Markus Mäkelä
f577d09829
MXS-3297: Don't advertise unsupported capabilities
Only bulk execute is supported. Supporting progress reporting currently
breaks the protocol result processing code.
2020-11-17 10:45:03 +02:00
Johan Wikman
df36ef86d0 2.4.14 Update Change Date 2020-11-16 14:23:26 +02:00
Markus Mäkelä
968d43799f
MXS-3273: Ignore unexpected responses
Unlike readwritesplit, schemarouter will process all responses from
backends as if they are expected. There are cases where errors are
generated that aren't sent as a response to a query. These queries must be
ignored and not routed to the client. Copying the code as-is from
readwritesplit isn't the cleanest solution but it avoids refactoring code
in a patch release.

The custom error number (2003) used by the backend protocol code was not
an actual error number that the server would send. The error code in
question was for an error that only the C connector returns:
CR_CONN_HOST_ERROR. Using ER_CONNECTION_KILLED as the error number better
conveys the fact that the connection was killed due to a reason not
related to any ongoing query.

By using a known error number that is correctly handled, we also avoid
writing errors to the client in the middle of a resultset or as the
initial response to a result. This explains why the problem described in
MXS-3267 happened in the first place: an unrelated connection was lost in
the middle of a resultset and the error was interpreted as the end of a
resultset. As a result of there being more data to be read, the unexpected
result state messages were logged.
2020-11-04 16:44:46 +02:00
Markus Mäkelä
87f97a16c3
Log server name in error message
This makes it clear which server failed.
2020-10-29 15:33:48 +02:00
Markus Mäkelä
dad5e09e5e
Merge branch '2.3' into 2.4 2020-10-19 15:08:22 +03:00
Markus Mäkelä
48ef9754df
MXS-3241: Check buffer length
The `is_set` call assumes that at least three characters are present.
2020-10-16 12:22:06 +03:00
Johan Wikman
faaf7f483e 2.4.13 Update Change Date 2020-10-14 09:15:46 +03:00
Johan Wikman
babcda3eca 2.4.12 Update Change Date 2020-08-24 09:42:48 +03:00
Markus Mäkelä
c5b47389df
MXS-3106: Always write the final COM_QUIT
This seems to help with a regression that was introduced in 2.4.11.
2020-08-21 14:38:37 +03:00
Esa Korhonen
759c63c8bb Merge branch '2.3' into 2.4 2020-08-20 17:44:09 +03:00
Esa Korhonen
87540f0ea0 MXS-3101 Improve proxy protocol header generation
Client connection file descriptor no longer read. The header now
contains the server's address instead of MaxScale's address.
2020-08-20 15:03:19 +03:00
Johan Wikman
63e4a63b62 MXS-3101 Log actual error for getpeername/getsockname 2020-08-07 12:47:15 +03:00
Johan Wikman
fc9c9fcd77 2.4.11 Update change date 2020-07-07 10:01:38 +03:00
Markus Mäkelä
608eb95284
MXS-3055: Prevent sending of an extra COM_QUIT
If the protocol routes a COM_QUIT packet to the backend, it must not
generate a packet when it is shutting down. This could cause unexpected
write errors if the backend server managed to close the socket before the
write was done.
2020-07-02 11:34:40 +03:00
Markus Mäkelä
a655c5d08c
MXS-619: Allow backend authentication to complete
By deferring the closing of a DCB until the protocol tells that it's in a
stable state, we avoid closing the connection mid-authentication. This
makes sure that all connections have reached a stable state before they
are closed which in turn prevents the connections from counting towards
aborted connects (or failed authentications like it did with the old fix).
2020-07-02 11:34:39 +03:00
Markus Mäkelä
ae2cad9254
MXS-619: Revert the partial fix
The fix causes a lot of confusion with the failed authentication messages
and is not worth it to fix the problem.
2020-07-02 11:22:22 +03:00
Johan Wikman
5ebae9be90 Merge branch '2.3' into 2.4 2020-06-05 09:36:24 +03:00
Johan Wikman
aa11c960b1 2.3.20 Update change date 2020-06-05 09:31:45 +03:00
Markus Mäkelä
727aeb4a08
Merge branch '2.3' into 2.4 2020-06-02 10:53:05 +03:00
Markus Mäkelä
cb8b4546cb
Don't use client SHA1 for fake responses
When a fake handshake response is generated for a connection that hasn't
received the server's handshake, the client's SHA1 would be used with a
static scramble. This, in theory, would weaken the authentication to some
extend so to completely prevent this, a null password is used. This
removes any possibility of the password being exposed.
2020-06-02 10:17:40 +03:00
Markus Mäkelä
d3d7054639
Merge branch '2.3' into 2.4 2020-04-24 16:09:20 +03:00
Johan Wikman
f527a8f2e6 2.3.19 Update Change Date 2020-04-23 14:23:57 +03:00
Markus Mäkelä
291d2e987f
Improve charset selection
The charset sent in the handshake is now done with the following
priorities:

* First Master server
* Last Slave server
* First Running server or Down server whose charset is known

The change is that server in the Down state to which we've successfully
connected to can also be used as the charset source. This, in addition
with an "empty" default charset, helps avoid the use of the default latin1
charset unless absolutely necessary.
2020-03-12 11:03:04 +02:00
Johan Wikman
d0ab797938 Merge branch '2.3' into 2.4 2020-03-12 10:33:57 +02:00
Johan Wikman
e0cd6adb26 Update change date for 2.3.18 2020-03-10 10:45:47 +02:00
Markus Mäkelä
eb0432b7b2
MXS-2860: Extract socket error only when needed
As the process of extracting the socket error also resets it, it should be
done only when necessary.
2020-03-06 13:56:42 +02:00
Johan Wikman
8b763fb88b Merge branch '2.3' into 2.4 2020-02-12 08:27:48 +02:00
Johan Wikman
919686f7ad Merge branch '2.3.17' into 2.3 2020-02-12 08:22:59 +02:00
Markus Mäkelä
d700fc32ed
Merge branch '2.3' into 2.4 2020-02-10 15:58:01 +02:00
Markus Mäkelä
c18f9c6bd7
MXS-2883: Handle AuthSwitchRequest packets
The backend didn't expect AuthSwitchRequest packets in response to the
handshake response packets. This is allowed by the protocol and appears to
happen with at least MySQL 8.0.
2020-02-10 15:35:47 +02:00
Johan Wikman
cfb3f79b54 Update 2.3.17 Change Date 2020-02-10 15:28:38 +02:00
Markus Mäkelä
6dd4a04c5d
cherry-pick: MXS-2803: Write all buffered data
Since the queued queries will never be inspected after the COM_CHANGE_USER
completes, they should all be written instead of only the first packet.
2020-01-23 18:38:05 +02:00
Johan Wikman
a7e0142224 Merge branch '2.3' into 2.4 2020-01-15 11:29:37 +02:00
Johan Wikman
790d90f229 Update 2.3.16 Change Date 2020-01-15 11:08:51 +02:00
Markus Mäkelä
3ed30327e5
Merge branch '2.3' into 2.4 2020-01-14 10:10:58 +02:00
Markus Mäkelä
a65220165a
Fix use of gw_get_shared_session_auth_info
If the client DCB of the session was passed into the function, it was
possible that the session pointer for it was already set to null. The
session pointer of an open DCB is never null but a client DCB's session
pointer can be null if accessed via the MXS_SESSION object.
2020-01-13 19:28:45 +02:00
Markus Mäkelä
6306519e5e
MXS-2710: Move client_count handling inside Session
By incrementing the counters when the session is created, we know that the
counter will always be decremented correctly. This does cause the listener
session to be counted as an actual session but this is already present in
the statistics calculations and is something we have to live with in 2.3
This change also makes it possible to overshoot the connection count
limitation as the session creation is delayed until authentication
fails. Both of these problems are fixed in 2.4.
2020-01-07 10:40:40 +02:00
Markus Mäkelä
5fe97808e3
Merge branch '2.3' into 2.4 2019-12-20 11:44:11 +02:00
Markus Mäkelä
484ff06795
MXS-619: Send fake response for unconnected DCBs
This causes the connection failure to be counted as an authentication
failure instead of a connection error. The former never causes the host to
be blocked which effectively solves the problem for most cases. The only
case where this would not work is where the network buffer for a backend
DCB is full right after the connection is created.
2019-12-19 14:21:27 +02:00