Commit Graph

7967 Commits

Author SHA1 Message Date
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
c49f17f428 MXS-3295: Fix layout of the classify endpoint
The values were stored in the parameters object which is used for
configuration parameters in other endpoints. The proper place for them is
inside the attributes object.
2020-11-16 09:20:50 +02:00
aa5a63be14 Fix debug argument concatenation
The buffer was shorter than the arguments given to it which caused a heap
buffer overflow.
2020-10-23 10:53:26 +03:00
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
6129f588a1 Don't parse COM_STMT_EXECUTE packets
The function information is only available for COM_QUERY packets.
2020-09-15 17:55:56 +03:00
63a050bd7a MXS-3051: Show connection TLS cipher
This tells the user whether a session is using TLS or not. Currently, only
the client TLS cipher is shown in MaxCtrl as the backend ciphers require
additional formatting.
2020-08-28 12:16:17 +03:00
ebdb9655e6 MXS-3143: Route FOUND_ROWS to last used target
This will cause the query to be routed to the same server where a possible
SQL_CALC_FOUND_ROWS was executed.
2020-08-28 11:49:07 +03:00
dbe94e2dbe MXS-3132: Fix monitor timeouts default values
The values are now what the documentation states they are.
2020-08-27 14:47:27 +03:00
e105f06ea3 Log latest session command on unexpected result 2020-08-21 09:50:29 +03:00
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
606ae6d2b0 MXS-3121 Log stmt being classified in fatal signal handler
This will make it easier to fix classifier related crashes.
2020-08-20 13:32:24 +03:00
c5870cbaba MXS-3121 Expose statement currently being classified
Intended to be used from fatal signal handlers. As the statement will
be returned only while classification is in process, if a statement
is returned, it is an indication that the crash was caused by the
classification.
2020-08-20 13:27:55 +03:00
7b7cded1cc MXS-3115: Don't process files in hidden directories
Hidden directories should be treated the same was as hidden files.
2020-08-19 12:15:25 +03:00
ffb237628c fix GCC 10 warnings 2020-07-27 10:42:38 +03:00
aaec73a8c8 MXS-3089: Close backend on failed session command
This correctly triggers the session command response processing to accept
results from other servers than the current master backend if the session
can continue. If the session cannot continue, it will be stopped
immediately.
2020-07-23 09:26:53 +03:00
cf1d1178d7 MXS-3087: Fix diagnostic memory leaks
Fixed leak in load_utils.cc and the cache filter. Also changed all
instances of json_object_set with json_object_set_new to make sure it's
only used when the references are to be stolen.
2020-07-22 13:27:36 +03:00
f2a837e2f1 Fix memory leak in throttlefilter
The filter would leak the buffer when it disconnects a client. This fixes
the throttlefilter test if it's run with ASAN or valgrind.
2020-07-15 15:35:12 +03:00
c9badcb09c Fix installation order of signal handlers
The shutdown signal handlers were installed before the workers were
initialized and weren't removed before the workers were deleted. This
would lead to a debug assertion and an eventual crash when a SIGTERM
signal was received outside of the expected scope.

The proper way to do this is to install the handlers only after the system
is up and running and to disable them as soon as the shutdown process
starts.

This mostly happened with the mxs621_unreadable_cnf test as it seemed to
receive a SIGTERM during the execution of the at-exit handlers.
2020-07-02 10:33:18 +03:00
aa11c960b1 2.3.20 Update change date 2020-06-05 09:31:45 +03:00
d025f5123e MXS-3023: Fix ID generator overflow
The result must always be non-negative.
2020-06-04 15:31:17 +03:00
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
c3dff9c60c MXS-3014: Add missing global parameters to REST API
A few global parameters weren't included in the list of parameters. A few
non-parameter values that were in the parameter object were moved out into
the attributes object. Sorted the parameter alphabetically.
2020-05-29 08:32:39 +03:00
b4108270dc MXS-2982: Fix documetation link in --help output 2020-05-11 07:44:57 +03:00
0ddee9613b MXS-2981: Treat missing TLS files as an error
Also treats partially defined TLS files as an error.
2020-05-11 07:44:56 +03:00
f527a8f2e6 2.3.19 Update Change Date 2020-04-23 14:23:57 +03:00
aacae9b508 MXS-2956: Fix use of admin_ssl_ca_cert
The parameter is now optional and uses the correct file. If defined, it
defines the CA certificate that would be used to verify client
certificate. Client certificate verification doesn't seem to currently
work as that requires a custom verification callback that interfaces with
GnuTLS.
2020-04-09 11:58:50 +03:00
7b00d2c01b MXS-2942: Only DELETE monitors with no servers
The behavior is now according to the documentation and is consistent with
how services behave.
2020-03-30 08:53:54 +03:00
e0cd6adb26 Update change date for 2.3.18 2020-03-10 10:45:47 +02:00
67fee60f80 Fix Auth Error server status
The mon_ping_or_connect_to_db resets the MYSQL handle which caused the
loss of the error message. Returning a new enumeration value for
authentication errors solves this problem.
2020-03-02 16:32:35 +02:00
e180c20055 MXS-2899: Update charset only when successful
By updating the server charset only when we successfully query it, the
charset will not change due to network connectivity problems.
2020-02-27 14:18:51 +02:00
b241f7ed2a MXS-2896: Fix monitor connection creation
The connection is now correctly null after a failed attempt to connect.
2020-02-24 12:02:50 +02:00
919686f7ad Merge branch '2.3.17' into 2.3 2020-02-12 08:22:59 +02:00
fd875cbf6d Remove faulty debug assertion
The use of the server state is not transactional across multiple uses of
the function. This means that any assertions on the target state can fail
if the monitor updates the state between target selection and the
assertion.
2020-02-11 22:34:39 +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
ef769573e4 MXS-2880 Fix typo in json output
"seconds_behing_master" -> "seconds_behind_master"
2020-02-10 12:59:30 +02:00
39cf6a8000 MXS-2860: Update last_read only on successful reads
This prevents empty or failed reads from updating the last_read flag which
in turn gives us the correct connection idle time when network errors
occur.
2020-02-10 10:46:32 +02:00
98e6bdcd90 MXS-2878: Enforce TLS for Connector-C connections
Connector-C connections now require TLS if the servers are configured with
it.
2020-02-10 10:46:32 +02:00
f6d848d58c MXS-2859: Treat newlines in strings as errors
Allowing raw newlines in string values breaks configuration serialization.
2020-01-30 10:44:00 +02:00
f53faba795 MXS-2857: Disable peer verification by default
The fix to the bug where peer certificates were validated but not required
caused the default behavior to change. The default should've changed at
the same time the fix was made.
2020-01-29 14:35:03 +02:00
a0affe1bb7 MXS-2784: Use SQL to fetch default character set
The Connector-C was changed to always return only the client's charset,
not the actual charset that the connection ends up using. To cope with
this, the code has to use SQL to join the default character set name to
the default collation for it which can be used to extract the numeric ID
of the charset.
2020-01-24 10:51:15 +02:00
4641dc208f Fix sescmd debug assert
The assertion will not hold for COM_CHANGE_USER. This prevents the debug
assertion but the actual backend code should also be changed.
2020-01-23 18:38:05 +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
c04d6748d3 Fix debug assertion on inconsistent sescmd result
The slave backend would be closed twice if it would both respond with a
different result and be closed due to a hangup before the master
responded.

Added a test case that reproduced the problem.
2020-01-23 18:38:05 +02:00
4f1ae70765 Allow multiple fatal signals
As long as the same thread never handles more than one fatal signal,
multiple fatal signals can be processed. This should guarantee that the
stacktrace is printed into the log while guaranteeing that recursion never
takes place if the handling of a fatal signal causes a fatal signal to be
emitted.
2020-01-23 18:37:57 +02:00
e2976a6689 MXS-2843: Remove password hash from log_info output 2020-01-21 09:27:08 +02:00
b573fcf030 MXS-2839: Make ssl_ca_cert optional
Not defining ssl_ca_cert causes the system default verification chain to
be used.
2020-01-17 09:21:06 +02:00
790d90f229 Update 2.3.16 Change Date 2020-01-15 11:08:51 +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
1d8139587b MXS-2710: Move client_count handling into client DCB
Due to the fact that both client connections and listeners use sessions in
2.3, the client_count tracking must be done inside the client DCB. In
addition to this, the max_connections check didn't take the current
pending connection into account which caused an off-by-one error.

This commit fixes the connection_limit test failure that was introduced by
commit 6306519e5e75575ba083ee2f0edfe7e624da5d26.
2020-01-13 17:12:04 +02:00