2985 Commits

Author SHA1 Message Date
Johan Wikman
f6731a898d Update change date 2019-11-13 08:37:17 +02:00
Johan Wikman
d67442356e Merge branch '2.3' into 2.4 2019-11-08 14:13:06 +02:00
Markus Mäkelä
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
Johan Wikman
fdfbf3e133 Update 2.4.3 change date 2019-11-05 12:21:00 +02:00
Johan Wikman
861e27eb00 Merge branch '2.3' into 2.4 2019-10-29 14:04:31 +02:00
Johan Wikman
df6c56e7ca Update 2.3.13 Change Date 2019-10-29 12:51:31 +02:00
Markus Mäkelä
4d51342561
Merge remote-tracking branch 'origin/2.3' into 2.4 2019-10-29 12:29:32 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
bd3107e7ca
Merge branch '2.3' into 2.4 2019-09-19 15:37:43 +03:00
Markus Mäkelä
f46f873dc1
Add verbose backend status helper
This allows the same verbose information to be logged in the cases where
it is of use. Mostly this information can be used to figure out why a
certain session was closed.
2019-09-19 13:41:49 +03:00
Markus Mäkelä
fd0c156655
MXS-2564: Reconnect only when necessary
By doing the reconnection only when a new query arrives, we prevent the
excessive reconnecting that is done when a server's actual and monitored
states are in conflict.
2019-09-19 13:41:49 +03:00
Markus Mäkelä
40d05e8278
Report more details when the master is unavailable
By dumping the connection state we'll know when the connection was opened
and closed and the reason why it was closed.
2019-09-19 12:55:31 +03:00
Esa Korhonen
78cc5b2445 Move packet_tracker.cc under maxscale
It depends on MaxScale-types. This also removes the maxsql-pcre2-dependency.
2019-09-18 12:19:09 +03:00
Markus Mäkelä
46a3c9f61c
Log interrupting packet's type during trx replay
This will allow non-SQL commands to be detected.
2019-09-04 15:40:52 +03:00
Esa Korhonen
68f3b235e1 MXS-2650 Fix SSL-use with Connector-C
Authenticators and monitors now use SSL when configured. The fix has two parts:
1) Removed the extra SSLConfig inside SSLProvider, as SSLContext already contains
the config.
2) When inputting parameter values to mysql_ssl_set(), empty strings are converted
to NULL-pointers as the function expects those for unused values.
2019-08-29 17:46:26 +03:00
Marko
0bb53bf411 Merge branch '2.3' into 2.4 2019-08-29 02:00:16 +03:00
Marko
7a1abc26d8 MXS-2631 Fix the ignoring of the system tables 2019-08-29 01:00:49 +03:00
Markus Mäkelä
16cc3cd64b
Fix negative expected response count on trx rollback
The expected reply count should only be decremented on success.
2019-08-14 14:50:34 +03:00
Markus Mäkelä
bf551c5b1e
Merge branch '2.3' into 2.4 2019-08-09 03:01:00 +03:00
Markus Mäkelä
1748e6599d
MXS-2609: Fix session command mixup on master failure
If a master failed during an ongoing session command history replay, it
would be treated as if a normal session command failed which would result
in the already executed session command being re-executed on all servers
at the wrong logical position.

To fix this, the history replay must be distinguished from normal session
command execution. When a connection replaying the history fails, the
query routing simply needs to be attempted again.
2019-08-09 01:54:09 +03:00
Markus Mäkelä
8bc4e42f2d
Fix query queuing on session command execution
If session command execution during server reconnection caused a query to
be queued, the query would be put on the tail end of the queue. This would
cause queries to be reordered if the queue wasn't empty. The correct thing
to do would be to put the next pending query back at the front of the
queue.
2019-08-09 01:54:09 +03:00
Markus Mäkelä
bb6f9213d4
Fix debug assert on master reconnection
If a master reconnection occurred after the session command history was
disabled due to the limit being exceeded, a debug assertion would be hit
in prepare_target. This assert makes sure that a connection can be safely
created to the server which means that in release mode builds the session
state would be inconsistent on the new master.

As this is an unrecoverable situation, the session should stop immediately
even if delayed_retry is enabled. Currently the session will continue
until the delayed retry timeout is hit. This happens due to the fact that
the delayed retry mechanism handles all errors in a similar way.
2019-08-09 01:54:09 +03:00
Johan Wikman
27f11df700 Merge branch '2.3' into 2.4 2019-08-08 08:07:59 +03:00
Markus Mäkelä
fd72332ea4
Improve master failure error message
The message will now always contain the server name.
2019-08-05 12:48:19 +03:00
Markus Mäkelä
9d0c6b908a
MXS-2603: Treat WSREP errors as ignorable errors
When a query returns a WSREP error, most of the time it is not something
the client application is expecting. To prevent this from affecting the
client, it can be treated the same way a transaction rollback is treated:
ignore the error and try again.
2019-07-30 13:53:23 +03:00
Marko
3940547cc2 Fix the name of the undefined rlag value
Older name was used due to merge from 2.3.
2019-07-29 22:27:16 +03:00
Marko
4503f02adb Merge branch '2.3' into 2.4 2019-07-29 15:52:22 +03:00
Markus Mäkelä
dda02b45ee
MXS-2520: Do master replacement if it's possible
This allows a new master to be chosen regardless of the target server
type.
2019-07-29 10:26:30 +03:00
Marko
a9b01ff4cc Merge branch '2.3' into 2.4 2019-07-28 21:43:58 +03:00
Marko
918a2964d5 MXS-2592 Add configuration for session specific in-memory log
When enabled each session will write log messages in the in-memory log.
If session ends in error this log is written to the actual log in disk.
2019-07-28 20:56:22 +03:00
Markus Mäkelä
b07ffdb2fa
Fix hang on transaction replay
The expected response counter was not decremented if a transaction replay
was started. This caused the connections to hang which in turn caused the
failure of the mxs1507_trx_stress test case.
2019-07-26 09:34:08 +03:00
Markus Mäkelä
f31f09fc66
Don't print errors with master_failure_mode=error_on_write
The errors are expeted and should not be logged.
2019-07-23 14:12:58 +03:00
Markus Mäkelä
12bd26398f
MXS-2486: Add missing schemarouter capabilities
The capabilities that the schemarouter declared were missing the
RCAP_TYPE_PACKET_OUTPUT which caused partial packets to be returned to it.
2019-07-23 09:57:53 +03:00
Markus Mäkelä
fbeb5d9c84
Always ignore server-internal databases
The mysql, information_schema and performance_schema databases should
always be ignored if found on multiple servers.
2019-07-23 09:38:29 +03:00
Markus Mäkelä
835049d506
Merge branch '2.3' into 2.4 2019-07-19 12:25:26 +03:00
Markus Mäkelä
1ddcbc9ae1
Log error message on slave session command failure
If the slave's response differs from the master and the slave sent an
error packet, log the contents of the error. This should make it obvious
as to what caused the failure.
2019-07-18 17:58:22 +03:00
Markus Mäkelä
2e70e2bc93
Merge branch '2.3' into 2.4 2019-07-18 12:49:00 +03:00
Markus Mäkelä
84f4688ebb
Fix readwritesplit response count assertion
The assertion in routeQuery that expects there to be at least one ongoing
query would be triggered if a query was received after a master had failed
but before the session would close. To make sure the internal logic stays
consistent, the error handler should only decrement the expected response
count if the session can continue.
2019-07-18 12:24:06 +03:00