Commit Graph

1926 Commits

Author SHA1 Message Date
75b17151f3 Removed FULL option from SHOW BINARY LOGS
If option ‘binlog_structure’ is set to ‘tree’ then SHOW BINARY LOGS
displays the tree details of the binlog files.

MySQL [(none)]> SHOW BINARY LOGS;
+--------------------------+-----------+
| Log_name                 | File_size |
+--------------------------+-----------+
| 0/10122/mysql-bin.000117 |      1167 |
| 0/10122/mysql-bin.000118 |       652 |
| 0/10124/foo-bin.000016   |      5082 |
| 0/10124/foo-bin.000017   |       491 |
+--------------------------+-----------+

With option set to ‘flat’ (which is the default) the output contains
only
names:

MySQL [(none)]> SHOW BINARY LOGS;
+------------------+-----------+
| Log_name         | File_size |
+------------------+-----------+
| mysql-bin.000110 |       425 |
| mysql-bin.000111 |     10409 |
| mysql-bin.000112 |      9659 |
+------------------+-----------+
2017-08-04 10:08:11 +02:00
ae5eb004fe SHOW [FULL] BINARY LOGS is now able to report the same log file in use with different server_ids
SHOW [FULL] BINARY LOGS is now able to report the same filename in use
with different server_ids: this can happen with binlog_structure=tree

example from SHOW FULL BINARY LOGS

0/10122/mysql-bin.000113
…
0/10122/mysql-bin.000116
…
0/5306/mysql-bin.000113

SHOW BINARY LOGS shows the same file twice:

mysql-bin.000113
…
mysql-bin.000116
…
mysql-bin.000113
2017-08-03 11:11:37 +02:00
d5de149e32 Update GTID repository while receiving ROTATE events and check the current file exists.
Update GTID repository while receiving ROTATE events and check the
current file exists.
2017-08-02 17:32:07 +02:00
7d8407ff22 Binlog Server doesn't start without last found GTID in the repo only if “mariadb10_master_gtid” option is On
Binlog Server doesn't start without last found GTID in the repo only if
“mariadb10_master_gtid” option is On
2017-08-02 11:56:32 +02:00
854c4a1ed3 Add support for non-glibc systems
MaxScale can now be built on systems that use an alternative libc
implementation e.g. musl.
2017-08-02 11:51:55 +03:00
782b8db2aa Fix readwritesplit handling of unexpected responses
The backend server can send a response even if the client hasn't sent a
request. One case where this occurs is when the server is shutting
down. The internal logic of readwritesplit can't handle unexpected states
gracefully so the safest thing to do is to just ignore them and send the
responses to the client.
2017-08-02 11:51:26 +03:00
0597b625d3 SHOW FULL BINARY LOGS reports domain_id/server_id prefix only if binlog_structure is TREE
SHOW FULL BINARY LOGS reports domain_id/server_id prefix only if
binlog_structure is TREE
2017-08-01 15:49:16 +02:00
f301c2ade1 The binary_logs_select_cb() returns now 0 after sending data to client
The binary_logs_select_cb() returns now 0 after sending data to client
2017-08-01 09:13:52 +02:00
3eb99139f5 Merge branch '2.1' into develop 2017-07-31 15:57:05 +03:00
39629c412d Binlog server: added prefix to last file in SHOW FULL BINARY LOGS
Binlog server: added prefix to last file in SHOW FULL BINARY LOGS
2017-07-31 10:27:18 +02:00
380fa35b4f Add Slave_pos for Using_Gtid in SHOW SLAVE STATUS only if Master GTID mode is set
Add Slave_pos for Using_Gtid in SHOW SLAVE STATUS only if Master GTID
mode is set
Possible output values are:

Default
   Using_gtid: No
or
   Using_gtid: Slave_pos
2017-07-27 10:13:25 +02:00
ed44c45be1 MXS-1323: Fix crash on attempted retry of read
When a backend is waiting for a response but no statement is stored for
the session, the buffer where the stored statement is copied is not
modified. This means that it needs to be initialized to a NULL value.

Added a test that checks that the behavior works as expected even with
persistent connections. A second test reproduces the crash by executing
parallel SET commands while slaves are blocked.

There is still a behavioral problem in readwritesplit. If a session
command is being executed and it fails on a slave, an error is sent to the
client. In this case it would not be necessary to close the session if the
master is still alive.
2017-07-25 11:25:43 +03:00
26bf342e6b Merge branch '2.1' into develop 2017-07-24 12:37:25 +03:00
f76e4cd61d Fix GCC 7 and OpenSSL 1.1 build failures
Fedora 26 and Debian 9 have both GCC 7 and OpenSSL 1.1. These fixes add
support for the newer versions of these libraries.
2017-07-24 10:38:47 +03:00
c7a45466fb Use Backend::write for all writes in schemarouter
The schemarouter should always use Backend::write for communication with
the backend servers. This keeps the backends in the correct state.

This fix solves some of the random test failures in the `sharding` test.
2017-07-18 11:36:54 +03:00
fd77b18c49 Remove false debug assertion in avrorouter
The asserted value can be false without it being an error. When a table is
re-mapped to a different position, there is no guarantee that the previous
value has not been reused by another table.
2017-07-13 12:30:24 +03:00
61241f9e07 Remove old feedback system
The feedback system wasn't used and was starting to cause problems on
Debian 9 where the libcurl required different version of OpenSSL than what
MaxScale was linked against.
2017-07-10 16:03:50 +03:00
96b98845a2 Allow filters to be used with binlogrouter
Filters can now be used with the binlogrouter to modify the contents of
the binlog stream now that the correct function call is used.
2017-07-07 10:37:30 +03:00
ef73f3e217 Merge branch '2.1' into develop 2017-07-06 11:25:36 +03:00
9618e63b5f MXS-1310: Add deterministic conflict resolution
The schemarouter can now resolve database mapping conflicts in a
deterministic manner. This will fix the problem of central databases which
are replicated shards being assigned in a non-deterministic manner.
2017-07-05 19:19:49 +03:00
0c33572a96 MXS-1310: Detect implicit database usage
When the current database is implicitly used in a query that also uses an
explicit database, it must be routed to the shard which has the current
database.

As cross-shard joins are not supported, the safest, and possibly the most
expected course of action to take, is to route it to the so-called default
shard. The default shard is the shard that contains the database that is
currently set as the active database with a COM_INIT_DB, a text protocol
USE <database> query or it was set at connection time.
2017-07-04 23:21:04 +03:00
c6b579619a MXS-1310: Route implicit table queries to the current shard
When a query that implicitly uses the current database is detected, it
will be routed to the shard which has the current database.
2017-07-04 23:04:27 +03:00
374c204a04 Only print text protocol statements in schemarouter
The schemarouter info level logging treated all queries as something that
contain SQL statements. This, for somewhat obvious reasons, cannot be
expected.
2017-07-04 22:26:24 +03:00
71bc67b694 Use unordered_map in schemarouter
The shard map doesn't have to be in order and an unordered map will do
just fine.
2017-07-04 13:01:04 +03:00
11d494ef33 Fix avro CREATE TABLE message
The string was assumed to be null-terminated when in reality it was not.
2017-07-04 12:40:22 +03:00
285086ba7c Fix ALTER TABLE regression in avrorouter
The avrorouter failed to detect ALTER TABLE statements which caused a
regression. Extended the alter table tests to parse the JSON for more
strict validation of test results.
2017-07-04 12:40:22 +03:00
5ed6483f01 Fix avro CREATE TABLE message
The string was assumed to be null-terminated when in reality it was not.
2017-07-04 12:21:25 +03:00
5c50045227 Fix ALTER TABLE regression in avrorouter
The avrorouter failed to detect ALTER TABLE statements which caused a
regression. Extended the alter table tests to parse the JSON for more
strict validation of test results.
2017-07-04 09:31:11 +03:00
729e9dbbae Added FAKE_ROTATE event info log
Added FAKE_ROTATE event info log.

Changed: log of Request file and pos only if the binlog_name is not
empty (it can be empty when setting the GTID value before CHANGE MASTER
TO)
2017-07-03 18:14:20 +02:00
7913f0ddf1 Develop Merge
Develop Merge
2017-06-30 10:48:13 +02:00
809dea34e0 Fix overlap of router->binlog_name in blr_file_create
A call to strcpy was made in blr_file_create where the function was given
the same pointer as both parameters. To avoid this, the file name is now
copied to a local variable before the router variables are modified.
2017-06-30 11:07:18 +03:00
9a42709da4 Properly terminate 'ping' subcommand list
The 'ping' subcommand list was missing the terminating value of
`{EMPTY_OPTION}`.
2017-06-30 11:07:18 +03:00
a19d93380e Make block_size a size parameter
The block_size signifies a size in bytes so it makes sense to change it to
the size type.
2017-06-30 11:07:18 +03:00
322fae8326 Add wrapper functions for buffer and original IV access
Added functions for accessing the buffer and original IV. This hides the
changes introduced in OpenSSL 1.1.
2017-06-30 10:46:05 +03:00
a47d4c40f5 Abstract EVP cipher context creation
The EVP_CIPHER_CTX is now created inside a wrapper function to add support
for OpenSSL 1.1. Also fixed improper use of the EVP_CIPHER_CTX internals
in binlogrouter.
2017-06-30 10:46:04 +03:00
cb57e10761 Develop merge
Develop merge
2017-06-29 15:34:22 +02:00
5597db255b Add wrapper functions for buffer and original IV access
Added functions for accessing the buffer and original IV. This hides the
changes introduced in OpenSSL 1.1.
2017-06-29 15:55:44 +03:00
09fb336403 Abstract EVP cipher context creation
The EVP_CIPHER_CTX is now created inside a wrapper function to add support
for OpenSSL 1.1. Also fixed improper use of the EVP_CIPHER_CTX internals
in binlogrouter.
2017-06-29 15:55:44 +03:00
8fb9b79dbb Make RWSplit::config() const
The function can be const.
2017-06-29 15:53:50 +03:00
3b3799889e MXS-852: Fix PS storage when locker to the master
When the router session is locked to the master, the storage of prepared
statements is not necessary as no other server can be used. The ID sent by
the client can be used without modification as it will always be the same
on the master.
2017-06-29 15:53:50 +03:00
1f8072f3d6 Fix temporary table detection in readwritesplit
The column information does not contain the used tables and the correct
function to use is qc_get_table_names.

Added a utility function for iterating over the set of tables. This
removes the need to have the same table iteration code in multiple places
and makes the code easier to comprehend.
2017-06-29 15:53:50 +03:00
5384162fb1 Fix slave server candidate ordering
The return value of the comparison was misinterpreted so that the
selection process preferred the new candidate over the current one if both
were equal. This was not an intended change and only a better candidate
should be chosen over the current candidate.
2017-06-29 15:53:50 +03:00
f7500cce9e Clean up route target resolution function
Cleaned up the function that resolves to which type of a server the query
should go.
2017-06-29 15:53:50 +03:00
dd05b44d38 Always extract the current command from the buffer
As readwritesplit queues queries, it needs to extract the command from the
buffer when the queued queries are routed. It cannot rely on the client
protocol command when the rerouting is taking place.
2017-06-29 15:53:50 +03:00
b0023e1689 Clean up readwritesplit API functions
Cleaned up some of the comments and documentation for the
functions. Renamed some variables and moved parts of the error handling
logging into a subfunction.
2017-06-29 15:53:50 +03:00
f2b199b3b0 MXS-852: Refactor gathering of routing information
The routing information is now gathered into a struct before the routing
process is started. This allows the requirements of the query to be
gathered before the actual target is selected.
2017-06-29 15:53:50 +03:00
a9a1291703 Split readwritesplit sources into separate parts
The common readwritesplit header was split into three distinct parts; the
instance, session and prepared statement headers. The definitions of any
members were moved to .cc files away from the headers.

The RWSplitSession, with its RWBackend class, is declared in the
rwsplitsession.hh header with all relevant definitions in
rwsplitsession.cc.

The PSManager class and all prepared statement related functions are now
located in the rwsplit_ps.hh header.

The old readwritesplit.hh header now contains the instance level
structures and all common classes used by the router. The
rwsplit_internal.hh header could be absorbed into the three newly created
headers with new headers for distinct parts of the router.
2017-06-29 15:53:50 +03:00
013b081b9e Rename readwritesplit router session class
Renamed the struct to RWSplitSession and removed the obsole next pointer.
2017-06-29 15:53:50 +03:00
917fe21f72 Refactor readwritesplit instance class
Changed the ROUTER_INSTANCE struct to a class and added functions for
common operations.

Renamed configuration and statistics structures and added constructors.

Moved objects around in readwritesplit.hh to be ready for a split into
multiple headers.
2017-06-29 15:53:50 +03:00
8ed16fd9d2 Reduce readwritesplit debug verbosity
Moved the LOG_RS output down to debug level. The output is not useful for
the end users.
2017-06-29 15:53:50 +03:00