Commit Graph

3015 Commits

Author SHA1 Message Date
b98b8f9d4a MXS-2939: Fix reconnection with session commands
Session commands did not trigger a reconnection process which caused
sessions to be closed in cases where recovery was possible.

Added a test case that verifies the patch fixes the problem.
2020-03-19 15:12:31 +02:00
552fdcb88a MXS-2938: Log session command info on routing failure
If the session command could not be routed, the log message should contain
the actual command that was routed. This makes failure analysis much
easier.
2020-03-19 15:12:31 +02:00
9609f5d180 Revert "MXS-2920: Allow max_slave_replication_lag=0"
This reverts commit ca69da49911074a9d218f05936282fd72a674af5 and removes
the bug from the release notes.
2020-03-17 06:58:26 +02:00
5217836e83 Update 2.4.8 Change Date
Same as that of 2.3.17. Consequently, only the 2.4 specific files
are updated.
2020-03-16 11:25:59 +02:00
ca69da4991 MXS-2920: Allow max_slave_replication_lag=0
A requirement of no lag should be allowed. The reason why it wasn't was
simply due to the selection of the default value.
2020-03-13 13:23:47 +02:00
76e855dc1d MXS-2919: Don't use slaves with unknown lag
If a limit on the replication lag is configured, servers with unmeasured
replication lag should not be used. The code in question did use them even
when a limit was set as the value used for undefined lag was -1 which
always measured lower than the limit.
2020-03-13 13:23:47 +02:00
d0ab797938 Merge branch '2.3' into 2.4 2020-03-12 10:33:57 +02:00
e0cd6adb26 Update change date for 2.3.18 2020-03-10 10:45:47 +02:00
912cb711e3 MXS-2844: Fix binlogrouter destruction
Binlogrouter services can now be destroyed at runtime.
2020-02-14 08:55:48 +02:00
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
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
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
8b763fb88b Merge branch '2.3' into 2.4 2020-02-12 08:27:48 +02:00
919686f7ad Merge branch '2.3.17' into 2.3 2020-02-12 08:22:59 +02:00
d63bd7ca80 Merge branch '2.3' into 2.4 2020-02-11 22:43:49 +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
cfb3f79b54 Update 2.3.17 Change Date 2020-02-10 15:28:38 +02:00
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
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
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
714dece7dd Update 2.4.6 Change Date
We use same as for 2.3.16.
2020-01-21 13:22:25 +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
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
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
f39ed6803e Merge branch '2.3' into 2.4 2019-12-17 14:04:47 +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
f6731a898d Update change date 2019-11-13 08:37:17 +02:00
d67442356e Merge branch '2.3' into 2.4 2019-11-08 14:13:06 +02:00
5c4ac03c07 Log a message in readconnroute's handleError
This way there's trace that something unexpected happened and that the
session closed unexpectedly.
2019-11-08 13:44:21 +02:00
fdfbf3e133 Update 2.4.3 change date 2019-11-05 12:21:00 +02:00
861e27eb00 Merge branch '2.3' into 2.4 2019-10-29 14:04:31 +02:00
df6c56e7ca Update 2.3.13 Change Date 2019-10-29 12:51:31 +02:00
4d51342561 Merge remote-tracking branch 'origin/2.3' into 2.4 2019-10-29 12:29:32 +02:00
639b0af6aa MXS-2734: Check preferred server on table conflict
If the schemarouter detects a table conflict in a query and one of the
servers is the preferred one, don't log an error.
2019-10-29 11:34:09 +02:00
ac5b5d527a MXS-2610: Prevent watchdog timeouts in avrorouter
The file processing can take a very long time and as it is done on a
routing worker, the workaround needs to be used.
2019-10-29 11:33:10 +02:00
b223e6eed3 MXS-2264: Add support for RENAME TABLE
RENAME TABLE is now fully supported and works as expected. With the fix to
table versioning, the new table name will receive the latest version
number.
2019-09-30 16:09:04 +03:00
7767231c8f MXS-2264: Fix table versioning
The table versions are now stored in memory and are only resolved on
startup. This simplifies things and removes the need to know where the
data is stored as that information is not available to the Rpl class.
2019-09-30 11:47:30 +03:00
2eb6a25534 MXS-2264: Add support for ALTER TABLE RENAME
This adds preliminary support for renaming tables. There is still a
problem where the table version will always be set to 1 on a rename. This
should not be done and the version should be set to the largest value that
ever was for that table.
2019-09-30 11:47:30 +03:00
a444484310 MXS-2702: Update m_current_master on session command
When lazy_connect is enabled and the first query is `SET autocommit=0`, a
master connection can be created. If it is, then the m_current_master
pointer must also be updated.

Also fixed the case where a failure to connect to one slave would cause
the connection attempts to stop too early.
2019-09-30 11:47:29 +03:00
27675ed41d MXS-2354: Fix subsecond part of temporal values
TIMESTAMP2, DATETIME2 and TIME2 values with decimal parts are now
correctly converted into their string forms. Previously the decimal part
was ignored but most of the code required to extract it was in place.
2019-09-30 11:47:29 +03:00
72d9e41ccb MXS-2263: Process unsigned integer columns correctly
The unsigned integers that would previously be interpreted as negative
values are now correctly converted into their corresponding avro
values. Due to a limitation in the Avro file format, 64-bit unsigned
integers cannot be represented in their unsigned form.

Since both the signed and unsigned versions of a 32-bit integer cannot fit
into a single Avro int, the type for these was changed to long. This is a
backwards incompatible change which means files generated with older
versions will not convert unsigned values correctly.
2019-09-30 11:47:27 +03:00
e1ff978b80 MXS-2263: Retain integer sign information
The unsignedness of a column is now retained in the Column type as well as
the JSON schema. This allows correct conversion of unsigned integer types
which will be done in a later commit.
2019-09-30 11:45:01 +03:00
117e2e7e88 Deliver notifications to registered clients
The notifications were delivered to all clients regardless of the
registration state.
2019-09-30 11:45:01 +03:00
bcf26fba3e Add missing COMMIT detection for non-transactional engines
Non-transactional engines will use a query event with a COMMIT in it to
signal that the transaction is over.
2019-09-30 11:45:01 +03:00
51d2d6c1f2 Fix GTID file path generation
The path would be invalid if there was no trailing slash.
2019-09-30 11:45:01 +03:00
9ce788ff0b MXS-2690: Fix duplicate database detection
Empty duplicate databases are now correctly detected since the results
will always return the database name combined with a trailing period.
2019-09-21 21:16:55 +03:00