6082 Commits

Author SHA1 Message Date
Markus Mäkelä
912cb711e3
MXS-2844: Fix binlogrouter destruction
Binlogrouter services can now be destroyed at runtime.
2020-02-14 08:55:48 +02:00
Johan Wikman
f576680ed9 Update 2.4.7 change date
Only the files that were not already updated as part of the
2.3.17 release.
2020-02-12 15:21:44 +02:00
Markus Mäkelä
fec1698db5
MXS-2889: Fix Replicator hang on shutdown
If a connection to the servers cannot be made, the replicator thread would
never exit.
2020-02-12 13:33:27 +02:00
Markus Mäkelä
3fc20d4345
MXS-2822: Use both last_write and last_read
The code relied on last_read for the idle time calculation which caused
the pings that were written to not reset the idle time. This increased the
chance of multiple COM_PING packets being sent to a backend before a reply
was received.
2020-02-12 13:33:27 +02:00
Johan Wikman
8b763fb88b Merge branch '2.3' into 2.4 2020-02-12 08:27:48 +02:00
Johan Wikman
919686f7ad Merge branch '2.3.17' into 2.3 2020-02-12 08:22:59 +02:00
Markus Mäkelä
d63bd7ca80
Merge branch '2.3' into 2.4 2020-02-11 22:43:49 +02:00
Markus Mäkelä
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
Markus Mäkelä
d700fc32ed
Merge branch '2.3' into 2.4 2020-02-10 15:58:01 +02:00
Markus Mäkelä
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
Johan Wikman
cfb3f79b54 Update 2.3.17 Change Date 2020-02-10 15:28:38 +02:00
Esa Korhonen
75ba527b1c Merge branch '2.3' into 2.4 2020-02-10 13:59:30 +02:00
Esa Korhonen
ef769573e4 MXS-2880 Fix typo in json output
"seconds_behing_master" -> "seconds_behind_master"
2020-02-10 12:59:30 +02:00
Markus Mäkelä
791d2ade99
Log latest error on broken master connection
When the master goes down, log the latest error if one is present.
2020-02-10 10:46:11 +02:00
Markus Mäkelä
25045c41a2
Merge branch '2.3' into 2.4 2020-01-24 13:06:42 +02:00
Markus Mäkelä
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
Markus Mäkelä
17916969b6
Merge branch '2.3' into 2.4 2020-01-24 09:48:05 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Johan Wikman
714dece7dd Update 2.4.6 Change Date
We use same as for 2.3.16.
2020-01-21 13:22:25 +02:00
Markus Mäkelä
fe1043219e
Merge branch '2.3' into 2.4 2020-01-21 09:33:41 +02:00
Markus Mäkelä
e2976a6689
MXS-2843: Remove password hash from log_info output 2020-01-21 09:27:08 +02:00
Johan Wikman
a7e0142224 Merge branch '2.3' into 2.4 2020-01-15 11:29:37 +02:00
Johan Wikman
790d90f229 Update 2.3.16 Change Date 2020-01-15 11:08:51 +02:00
Markus Mäkelä
3ed30327e5
Merge branch '2.3' into 2.4 2020-01-14 10:10:58 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
b555115fa2
Merge branch '2.3' into 2.4 2020-01-07 11:12:02 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
964207cbea
MXS-2820: Return correct value on wrong password 2020-01-02 11:34:47 +02:00
Markus Mäkelä
5fe97808e3
Merge branch '2.3' into 2.4 2019-12-20 11:44:11 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
4ae22f9991
Merge branch '2.3' into 2.4.5 2019-12-19 10:03:35 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Johan Wikman
a9a2b753c0 Update 2.4.5 change date 2019-12-18 13:25:03 +02:00
Markus Mäkelä
f39ed6803e
Merge branch '2.3' into 2.4 2019-12-17 14:04:47 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
ad323bb837
Merge branch '2.3' into 2.4 2019-12-13 11:24:42 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
90f7c69f9d
Fix database renaming with no default database
If no default database was given, it was possible that the code would end
up in an endless loop.
2019-12-13 10:49:35 +02:00
Markus Mäkelä
cb4e43b05a
MXS-2794: Log changes in loaded users
By checking whether the users have changed whenever they are reloaded, we
improve the visibility of the user reloading process. Using a checksum
allows us to easily compress the information with acceptable loss of
accuracy. Using a CAS loop prevents duplicate messages without losing any
updates even if multiple user reloads result in different outcomes.
2019-12-10 09:41:42 +02:00