Commit Graph

518 Commits

Author SHA1 Message Date
dc895e41ad Merge branch '2.3' into 2.4 2019-10-11 09:51:48 +03:00
1202c00fc7 MXS-2721: Check that LocalClient creation succeeds
The creation can fail if a network socket cannot be opened and connected
to the host in question.
2019-10-10 21:24:35 +03:00
428bc5740b MXS-2645 Decrement service client count also when authentication fails
The client count was incremented before authentication was complete, and
should be decremented if it fails. Otherwise service connection limit can
be easily reached.
2019-10-04 15:11:09 +03:00
2d9d9356c9 Merge branch '2.3' into 2.4 2019-10-04 12:56:52 +03:00
869effc352 MXS-2707: Retain commands that respond
Only commands that return a response should to be retained. Otherwise the
bookkeeping of m_current_query will be wrong.
2019-10-03 22:17:44 +03:00
f9a6649d77 Merge branch '2.3' into 2.4 2019-09-24 21:42:32 +03:00
fcc7642328 MXS-2694: Add support for COM_BINLOG_DUMP
The resultset processing now understands COM_BINLOG_DUMP and treats it as
a never-ending resultset.
2019-09-24 21:41:24 +03:00
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
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
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
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
ee83a6ca0d fix memory leak on handling COM_CHANGE_USER 2019-07-12 11:52:23 +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
74d15cee09 MXS-2562: Always send errors with sequence number 1
As is explained in MDEV-19893:

   Client reads from socket, gets the packet from 1. with seqno=0, which
   it does not expect, since seqno is supposed to be incremented. Client
   complains, throws tantrums and exceptions.

To cater for clients that do not expect out-of-bound messages
(i.e. server-initiated packets with seqno 0), all messages generated by
MaxScale should use at least sequence number 1.
2019-06-28 20:25:31 +03:00
5ab5e914e7 MXS-2582: Deep-copy PS buffers in RWBackend::write
Deep-copying prevents subsequent modifications done by the caller from
affecting the data that can be potentially stored in the write queue of
the backend's DCB.
2019-06-28 09:46:15 +03:00
fcc19f3c66 Merge branch '2.3' into 2.4 2019-06-27 08:53:33 +03:00
25a076d072 Fix buffer sizes in PS extraction code
The code used 4 byte buffers for 2 byte values.
2019-06-26 15:49:50 +03:00
d41d4021a8 Merge branch '2.3' into 2.4.0 2019-06-26 09:20:35 +03:00
67d82146f1 Fix packet length assertion
The `used_len + len` can be the same as `total_len`.
2019-06-26 09:19:24 +03:00
88dae197b0 Make packet boundary assertion less costly
mxs::Buffer::iterator is not a random-access iterator and hence will have
linear cost. This is too costly to do on every packet with even moderately
sized resultsets.
2019-06-26 09:13:03 +03:00
f961bf1d96 Merge branch '2.3' into 2.4.0 2019-06-25 11:46:44 +03:00
b8bb8702bd Fix broken Change Dates
Were not correct, so were not updated with all others.
2019-06-25 09:52:42 +03:00
2ab9aa9a94 Update 2.4.0 Change Date 2019-06-25 09:19:55 +03:00
873ea92915 Assert that packet is inside the buffer
The buffer containing the response should contain only complete packets.
2019-06-25 09:05:49 +03:00
f5615cc174 MXS-2555 Add support for unix sockets to LocalClient 2019-06-19 15:31:34 +03:00
2343326ecc MXS-2555 Add execute_kill version, that kills all but a given mysql_thread_id
NOTE: This does not work whit unix scokets. The reason is that LocalClient
assumes network sockets. TODO: to add unix socket support.
2019-06-19 15:31:34 +03:00
56e5c417c1 MXS-2555 uncrustify mysql_common.cc, and a minor bug fix in smartrouter.cc 2019-06-19 15:31:34 +03:00
7dde0edb54 Clean up unexpected error handling in readwritesplit
By using the Error class, the code can be cleaned up and simplified.
2019-06-14 15:18:01 +03:00
c819271cab Merge branch '2.3' into develop 2019-06-14 09:40:19 +03:00
2accfad329 Handle trailing unexpected ERR packets
RWBackend did not expect that a resultset and an unexpected ERR packet
could be stored in the same buffer. This can happen for example if a
server shuts down immediately after the resultset is sent.
2019-06-14 08:12:02 +03:00
8311dba654 Send the OK outside the KILL functions
By sending the OK for the KILL commands outside the function, they can be
used to kill connections that do not expect responses.
2019-06-13 16:44:26 +03:00
1f46f1bfca Merge branch '2.3' into develop 2019-06-12 12:24:07 +03:00
bb92d61a1b Fix KILL command packet boundary detection
If a packet with a KILL query was followed with another packet in the same
network buffer, the code wouldn't work as it expected to receive only one
packet at a time.
2019-06-12 12:20:26 +03:00
a2b046a482 MXS-2512 Use typenames consistently 2019-06-11 09:44:27 +03:00
b09a4e676d MXS-2512 Do not recalculate information that exists
As the end of the error packet is known, it is better to pass
around an iterator to that instead of recalculating it.
2019-06-11 09:44:27 +03:00
b222a17ed9 MXS-2512 Update error information in additional place
An error may be returned directly or as part of a result set.
Both cases must be handled.
2019-06-11 09:44:27 +03:00
aa9b6cb8c5 MXS-2512 Store received error during backend processing
If a server returns an error, it will be retained inside RWBackend
so that it later is accessible without having to parse the GWBUF
again.
2019-06-11 09:44:27 +03:00
4efa9dbeea Remove maxscale/alloc.h
The remaining contents were moved to maxbase/alloc.h.
2019-06-10 14:11:25 +03:00
655e5fab5b Move length-encoded integer/string functions to maxsql 2019-06-07 11:32:46 +03:00
44d1b821c3 Merge branch '2.3' into develop 2019-06-03 13:54:55 +03:00
c219187a1e Merge branch '2.2' into 2.3 2019-06-03 13:27:57 +03:00
d68f66fede MXS-2538: Send master charset in the handshake packet
By iterating over the servers and sending the master's charset we are
guaranteed a "known good" charset. This also solves the problem where a
deactivated server reference would be used as the charset and server
version source.
2019-05-31 23:01:18 +03:00
e9c652555d MXS-2538: Fix hang on unknown KILL
Unknown KILL commands are now forwarded as-is to the routers.
2019-05-31 14:01:16 +03:00
3af66f3309 MXS-2483: Take SSLProvider into use
Servers and listeners now have a SSLProvider member variable that is used
for all SSL related tasks.
2019-05-24 15:33:17 +03:00
8a4b58d52c MXS-2483: Move SSL configuration into SSLConfig
This way the configuration information can be accessed without the
SSLContext.
2019-05-24 15:33:17 +03:00
5b55864b06 MXS-2483: Store listener SSLContext in unique_ptr
Also removed some unnecessary checks for session->listener: The Session
constructor takes the listener as an argument.
2019-05-24 10:05:43 +03:00