Commit Graph

8921 Commits

Author SHA1 Message Date
a311613935 MXS-2858: Fix backend side throttling
The code registered both client and backend callbacks for backend
DCBs. This caused the whole connection to hang if backend side throtting
was ever triggered.
2020-01-29 14:35:52 +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
25045c41a2 Merge branch '2.3' into 2.4 2020-01-24 13:06:42 +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
17916969b6 Merge branch '2.3' into 2.4 2020-01-24 09:48:05 +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
714dece7dd Update 2.4.6 Change Date
We use same as for 2.3.16.
2020-01-21 13:22:25 +02:00
fe1043219e Merge branch '2.3' into 2.4 2020-01-21 09:33:41 +02:00
e2976a6689 MXS-2843: Remove password hash from log_info output 2020-01-21 09:27:08 +02:00
aa84c4dc7e MXS-2821: Improve REST API errors
The error message now states what the real reason of the error was.
2020-01-21 09:18:32 +02:00
df3ae56952 Merge branch '2.3' into 2.4 2020-01-17 09:26:50 +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
60416f5b96 Fix max_connection for 2.4
The merge from 2.3 caused the mechanism to break in 2.4 where the old code
was correct.
2020-01-16 12:10:31 +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
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
6c14ac7829 MXS-2834: Make retrying of trx deadlocks configurable
The behavior is not desirable in all cases and should be enabled only if
needed.
2020-01-11 11:53:01 +02:00
09c55111cc Merge branch '2.3' into 2.4 2020-01-09 06:59:00 +02:00
6e8318f72f MXS-2829: Remove config file when deleting a filter 2020-01-08 15:30:15 +02:00
b555115fa2 Merge branch '2.3' into 2.4 2020-01-07 11:12:02 +02:00
36b0196c3e MXS-2825: Fix basic user privileges
All POST, PUT, DELETE and PATCH commands should be prevented regardless of
whether they define a request body.
2020-01-07 10:40:41 +02:00
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
aa83bc24ae MXS-2820: Log default database on auth failure
The default database was not exposed in the warning that was logged when
authentication failed. The authentication uses the username, host and the
default database to find the user entry and the lack of the default
database made it hard to know for sure which user entry a client should've
matched against.
2020-01-02 12:00:10 +02:00
964207cbea MXS-2820: Return correct value on wrong password 2020-01-02 11:34:47 +02:00
9428c31bc4 Merge branch '2.3' into 2.4 2020-01-02 11:22:52 +02:00
1092203779 Allow non-head use of gwbuf_copy_data
Non-head links in a buffer chain can now be used with gwbuf_copy_data
without triggering the debug assertion.
2019-12-31 07:26:17 +02:00
03d45c2ace 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.
2019-12-31 07:26:16 +02:00
ff78a8bca5 Fix api reseponse 2019-12-30 10:06:59 +02:00
5fe97808e3 Merge branch '2.3' into 2.4 2019-12-20 11:44:11 +02:00
61b8bbf7f6 Allow non-GTID replication without rewrite_src
The filter allowed only GTID replication when file-and-position based
replication should be allowed as well.
2019-12-20 11:05:46 +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
e725ebb7d0 Add missing set of fake event flag
The FakeEventTask called the actual DCB handler with a fake task but it
didn't set the fake event flag. This caused KILL queries to be treated as
if they were network errors.
2019-12-19 11:31:51 +02:00
4ae22f9991 Merge branch '2.3' into 2.4.5 2019-12-19 10:03:35 +02:00
a73b183555 MXS-2813: Mask password values in output
The password values are now masked with asterisks. This tells whether a
password is set or not but it does not expose any information about the
password itself.
2019-12-19 09:56:00 +02:00
5224fa5625 MXS-2585: Add temporary workaround
Added a debug assertion that will catch the problem in debug builds and
some release mode code that prevents crashes if this ever happens.
2019-12-18 13:52:37 +02:00
a9a2b753c0 Update 2.4.5 change date 2019-12-18 13:25:03 +02:00
e56cf41160 MXS-2809: Update links in example config 2019-12-18 09:58:23 +02:00
f39ed6803e Merge branch '2.3' into 2.4 2019-12-17 14:04:47 +02:00
be088c54b4 Add LOAD DATA INFILE support
The events are similar to normal query events except that they have an
extra 13 bytes of static data. This data is of no relevance to Maxscale
and thus can be ignored. This also allows the reuse of the same query
event code for execute load query events.
2019-12-17 13:54:08 +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
78cc8f17b3 Replace debug assertion with warning
It appears that rollback errors are possible outside of
transactions. Since this was not something we expected to see, logging it
as an error allows us to see why this happens in production deployments.
2019-12-17 13:53:06 +02:00
b0a1eddb6c Store ignored error information
The errors that are ignored by readwritesplit are now stored as the
current close reason in the Backend. This allows the information about the
error to be retained and it can be used later in the error handler to
display the true reason why the connection was closed.
2019-12-17 13:48:51 +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