Commit Graph

88 Commits

Author SHA1 Message Date
8b763fb88b Merge branch '2.3' into 2.4 2020-02-12 08:27:48 +02:00
919686f7ad Merge branch '2.3.17' into 2.3 2020-02-12 08:22:59 +02:00
d700fc32ed Merge branch '2.3' into 2.4 2020-02-10 15:58:01 +02:00
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
cfb3f79b54 Update 2.3.17 Change Date 2020-02-10 15:28:38 +02:00
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
a7e0142224 Merge branch '2.3' into 2.4 2020-01-15 11:29:37 +02:00
790d90f229 Update 2.3.16 Change Date 2020-01-15 11:08:51 +02:00
3ed30327e5 Merge branch '2.3' into 2.4 2020-01-14 10:10:58 +02:00
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
5fe97808e3 Merge branch '2.3' into 2.4 2019-12-20 11:44:11 +02:00
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
a9a2b753c0 Update 2.4.5 change date 2019-12-18 13:25:03 +02:00
a1009824a6 RCAP_TYPE_STMT_OUTPUT needs complete packets
It was possible that a null buffer was passed to clientReply if the
RCAP_TYPE_STMT_OUTPUT capability was needed and a partial packet was read.
2019-12-17 13:53:06 +02:00
ad323bb837 Merge branch '2.3' into 2.4 2019-12-13 11:24:42 +02:00
e057c751cd Improve handleError error messages
The hangup and error handlers now have unique messages. Although the
behavior in the handlers is practically the same in both cases, the cause
of the error is not the same.

If a socket error is present, it is added to the error message. If an
error is present, it should clearly show the reason why the TCP socket was
closed.

The is_fake_event boolean helps distinguish fake events from real
ones. This makes figuring out the real source of hangup events easier.
2019-12-13 10:50:04 +02:00
c1b5d70eea 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.
2019-12-13 10:49:36 +02:00
2b56737868 Fix debug assertion
The GWBUF_IS_CONTIGUOUS macro changed in 2.4 and it no longer allows null
arguments.
2019-12-13 10:49:36 +02:00
f6731a898d Update change date 2019-11-13 08:37:17 +02:00
fdfbf3e133 Update 2.4.3 change date 2019-11-05 12:21:00 +02:00
861e27eb00 Merge branch '2.3' into 2.4 2019-10-29 14:04:31 +02:00
df6c56e7ca Update 2.3.13 Change Date 2019-10-29 12:51:31 +02:00
5b3c0b8b81 Merge branch '2.3' into 2.4 2019-07-16 13:17:35 +03:00
c878d796be Merge branch '2.2' into 2.3 2019-07-16 12:59:03 +03:00
4d5b9cae9c MXS-2593: Remove unnecessary hangups
The backend DCBs do not have to send hangups in the close protocol API
method. If the conditions for the hangup were true, the session was
already stopping meaning that the client DCB was already closed.
2019-07-06 08:15:22 +03:00
3e85500491 Merge branch '2.3' into 2.4 2019-07-02 08:38:15 +03:00
40f35618ad MXS-2562: Fix out-of-order error during COM_CHANGE_USER
If an error is generated while a COM_CHANGE_USER is being done, it would
always use the sequence number 1. To properly handle this case and send
the correct sequence number, the COM_CHANGE_USER progress needs to be
tracked at the session level.

The information needs to be shared between the backend and client
protocols as the final OK to the COM_CHANGE_USER, with the sequence number
3, is the one that the backend server returns. Only after this response
has been received and routed to the client can the COM_CHANGE_USER
processing stop.
2019-06-28 20:25:31 +03:00
0ba779d5a2 Update 2.4.0 Change Date 2019-06-25 10:11:55 +03:00
4efa9dbeea Remove maxscale/alloc.h
The remaining contents were moved to maxbase/alloc.h.
2019-06-10 14:11:25 +03:00
7eff7f8e9e Remove unused function in mysql_common.cc 2019-05-24 10:05:15 +03:00
0c19d1ea03 Fix debug assertion in mysql_backend
The backend read function used a NULL GWBUF with gwbuf_length.
2019-05-21 13:15:20 +03:00
0f714e9ad4 MXS-2495 Cleanup GWBUF interface
All GWBUF macros that address a single link in a chain are now
simple wrappers for equivalent gwbuf_link-functions.

Next step is to drop the macros and replace their use with calls
to the functions.
2019-05-20 09:57:37 +03:00
22a9e20f1f MXS-1957 Change the default authenticators to MariaDB aliases
Using MySQLAuth or MySQLBackendAuth causes warning to be logged.
2019-05-13 15:35:09 +03:00
a3bb61486d Move server_set_status and server_clear_status to monitor
The operation goes through monitor code so should be in the according file.
2019-05-10 14:37:35 +03:00
6625c1296b Format authenticator and protocol modules 2019-05-10 10:31:12 +03:00
70450ce881 MXS-2349: Add support for UNIX domain sockets
Added core functionality for UNIX domain sockets in servers. Currently the
address parameter accepts them both but a separate `socket` parameter is
needed.
2019-04-16 11:52:37 +03:00
1c3a5bda83 Merge branch '2.3' into develop 2019-03-11 12:29:56 +02:00
7db87784ac Deliver hangups only to valid DCBs
If a DCB was closed and a hangup event was sent to it via
dcb_hangup_foreach shortly after it was closed, the DCB would still
receive it even if it was closed. To prevent this, events must only be
delivered to DCBs if they haven't been closed.
2019-03-08 12:10:30 +02:00
95317725ce Merge branch '2.3' into develop 2019-03-07 16:21:03 +02:00
5b43940559 Track session state only when required
The protocol should not track the session state as the parsing is quite
expensive with the current code. This change is a workaround that enables
the parsing only when required. A proper way to handle this would be to do
all the response processing in one place thus avoiding the duplication of
work.
2019-03-07 15:59:26 +02:00
9572ff84ea Merge branch '2.3' into develop 2019-03-05 10:37:56 +02:00
7fb2ae571b Improve blocked host error message
The error now explains how the problem can be mitigated by increasing
max_connect_errors on the backend server.
2019-03-04 08:53:12 +02:00
661f1dd4e4 Merge branch '2.3' into develop 2019-02-11 13:14:52 +02:00
d04fc6c4b9 Merge branch '2.2' into 2.3 2019-02-08 16:14:58 +02:00
a3fa2f8111 Merge branch '2.3' into develop 2019-01-16 16:31:14 +02:00
021d48f94c Log low-level reason and idle time on master failure
If the connection to the master is lost, knowing what type of an error
caused the call to handleError helps deduce what was the real reason for
it. Logging the idle time of the connection helps detect when the
wait_timeout of a connection is exceeded.
2019-01-16 09:43:49 +02:00
45bfbbdd9e Convert maxscale/protocol.h to .hh 2019-01-15 17:26:26 +02:00
684ec3288b Rename and cleanup authenticator.h 2019-01-14 15:07:33 +02:00
1c647f3753 MXS-2220 Move most remaining functions inside class
Most of the ones still remaining outside are special cases.
Also, removed locking from status manipulation functions as it
has not been required for quite some time.
2019-01-08 15:15:34 +02:00
40485d746c MXS-2220 Change server name to constant string 2019-01-03 12:13:15 +02:00