Commit Graph

8900 Commits

Author SHA1 Message Date
faaf7f483e 2.4.13 Update Change Date 2020-10-14 09:15:46 +03:00
933ce0c86a MXS-3220: Fix crash on failed master history replay
This could happen if a session command triggers a master reconnection and
the connection fails while the history replay is ongoing. The code assumed
that history replay would only happen when a query was in the query queue.
2020-10-13 14:31:49 +03:00
ab4ac8e588 MXS-3200 Log mapping error as it will lead to session close 2020-10-12 08:31:36 +03:00
147ed8ef22 MXS-3200 Ensure that passed in p to buffer remains valid
The pointer to pointer to GWBUF must in all cases be updated.
Otherwise it will lead to
1) access to free data, and
2) a double delete.
2020-10-12 08:31:36 +03:00
c25099da01 Improve SSL error message
Log the type of the DCB to help figure out where the error came from.
2020-09-22 16:42:16 +03:00
0be629e5c5 Merge branch '2.3' into 2.4 2020-09-15 18:02:24 +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
9304230212 MXS-3149 Properly remove master-status from server during demotion
Removing it from the pending status field has not effect as the
pending changes have all ready been written to real status.
2020-09-02 15:13:23 +03:00
caedf79464 Merge branch '2.3' into 2.4 2020-08-28 14:24:16 +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
bce427f4ad Merge branch '2.3' into 2.4 2020-08-27 15:21:36 +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
babcda3eca 2.4.12 Update Change Date 2020-08-24 09:42:48 +03:00
df87df3a0d Reduce slow DCB shutdown timeout to 2 seconds
This helps reduce the effect that a hanging connection has on the whole
system.

Making this configurable shouldn't be needed as long as the rate of
authentication failures doesn't exceed an acceptable level. In most
practical cases allowing two seconds for authentication to complete should
be enough.
2020-08-21 14:38:37 +03:00
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
b90d42b999 Merge branch '2.3' into 2.4 2020-08-21 10:27:43 +03:00
e105f06ea3 Log latest session command on unexpected result 2020-08-21 09:50:29 +03:00
759c63c8bb Merge branch '2.3' into 2.4 2020-08-20 17:44:09 +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
c0cd751215 Merge branch '2.3' into 2.4 2020-08-20 14:29:16 +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
f3d4c27e58 Merge branch '2.3' into 2.4 2020-08-19 12:20:49 +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
49ea5da9e2 MXS-3100 Fix memory leak in top-filter 2020-08-10 15:36:19 +03:00
63e4a63b62 MXS-3101 Log actual error for getpeername/getsockname 2020-08-07 12:47:15 +03:00
ce05b68030 Merge branch '2.3' into 2.4 2020-07-27 14:55:58 +03:00
ffb237628c fix GCC 10 warnings 2020-07-27 10:42:38 +03:00
5c76d3d906 Merge branch '2.3' into 2.4 2020-07-24 08:01:53 +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
ea35b62373 MXS-619: Delay destruction of the client DCB
By delaying the processing of a client DCB in the zombie queue, we avoid
initiating the shutdown process of the backend DCBs too early. This solves
the problem of the previous implementation where the session shutdown
proceeded too far before the delaying process started.
2020-07-14 10:47:38 +03:00
6abdb60b58 MXS-619: Temporarily disable the fix
The fix isn't fully functional as closed DCBs never process the events
they receive. The mechanism would work if certain events would be
processed but they'll have to be fixed in a later release.
2020-07-13 15:02:47 +03:00
fc9c9fcd77 2.4.11 Update change date 2020-07-07 10:01:38 +03:00
32fa7b6800 MXS-3069: Fix plugin name comparison
Connectors that wouldn't send the plugin name even when the plugin
authentication capability was enabled would have to do an extra step in
the authentication.
2020-07-07 09:23:23 +03:00
6c9249131f MXS-3064: Use latin1 charset
This prevents the server from selecting the charset under which the
queries are processed which can result in conflicts if the tables used are
not compatible with the charset of the string literals used in the query.
2020-07-07 09:23:22 +03:00
4fe71b41ed MXS-3038: Don't connect to lagging slaves
There's no use connecting to a lagging slave if a replication lag limit
has been set.
2020-07-07 09:23:22 +03:00
7520efd218 MXS-3059: Don't use STL containers concurrently
The diagnostics_json call could access the std::unordered_map at the same
time it was being updated by the monitoring thread. This leads to
undefined behavior which in the case of MXS-3059 manifested as a segfault.
2020-07-07 09:23:22 +03:00
ad4bd26ff0 MXS-2585: Check for failed allocations
Since nothrow was used, the return value should be checked. By moving the
null-check after the node allocation part, we'll detect it.
2020-07-07 09:23:22 +03:00
ba289dc589 Fix debug assertion in cache
The call to gwbuf_length will fail if the pointed to buffer isn't the head
of the chain. To prevent this, the length is calculated before the buffer
is appended.

Also fixed the use of gwbuf_append. The return value should be assigned
and the code shouldn't reply on the value passed to the function being
correct.
2020-07-07 09:23:22 +03:00
7ad3485892 MXS-3054: Fix crash on malformed mapping reply
The code used a null GWBUF with gwbuf_append which causes a crash. The
return value of the function that used it was also not correctly handled
and would be mistaken for a different error.
2020-07-02 11:34:40 +03:00
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
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
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
1ad8ae97d3 MXS-3054: Prevent pooling of DCBs with inbound data
If a DCB is expecting a response from the server, it must not be placed
into the connection pool. This prevents the case where unexpected
responses would be delivered to DCBs taken out of the connection pool.
2020-07-02 11:22:22 +03:00
9f07613330 Merge branch '2.3' into 2.4 2020-07-02 10:38:54 +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
a4a7a52150 Merge branch '2.4.10' into 2.4 2020-06-08 11:40:41 +03:00