7332 Commits

Author SHA1 Message Date
Johan Wikman
7cb3c68d1e MXS-1380 Parse UNIONs completely
Before this change, only db2.t2 was reported as table name for a
select like

    select * from db1.t1 union select * from db2.t2

With this change, db1.t1 and db2.t2 are reported.
2017-08-31 13:27:02 +03:00
Markus Mäkelä
c5581faae7 Always collect contiguous results for COM_CHANGE_USER
The response to the COM_CHANGE_USER should always be turned into a
contiguous buffer of complete packets. This guarantees that the code that
processes it functions properly.
2017-08-29 22:24:00 +03:00
Markus Mäkelä
866a15dafa Skip COM_CHANGE_USER for COM_QUIT
As COM_QUIT would terminate the connection, there's no need to initiate
the session reset process. Also make sure all buffers are empty before
putting the DCB into the pool.

Added extra debug assertions for parts of the code that are related to the
COM_CHANGE_USER processing.
2017-08-29 11:15:06 +03:00
Markus Mäkelä
abd99febcf Fix possible crash on show sessions
The function that printed all sessions assumed that all client DCBs had
valid, non-dummy sessions. It is possible that a client with a dummy
session is the list. These sessions should be ignored.
2017-08-25 18:16:07 +03:00
Markus Mäkelä
bc889b1b41 MXS-1375: Fix double response to COM_CHANGE_USER
When a persistent connection is reused, a COM_CHANGE_USER command is
executed to reset the session state. If the reused connection was closed
before the response to the COM_CHANGE_USER was received and taken into use
by another connection, another COM_CHANGE_USER would be sent to, again,
reset the session state. Due to the fact that the first response is still
on its way, it will appear as if two responses are generated for a single
COM_CHANGE_USER.

The way to fix this is to avoid putting connections that haven't been
successfully reset into the connection pool.
2017-08-24 09:30:08 +03:00
Markus Mäkelä
bc1e2a844c MXS-1374: Add persistpoolmax and persistmaxtime to alter server
The alteration of a server's persistpoolmax and persistmaxtime parameters
appeared to work when in reality it did not change the values.
2017-08-24 09:21:00 +03:00
Markus Mäkelä
5b1f8afcd9 MXS-1366: Validate closed connections before pooling them
When a session is being closed in a controlled manner, i.e. a COM_QUIT is
received from the client, it is possible to deduce from this fact that the
backend connections are very likely to be idle. This can be used as an
additional qualification that must be met by all connections before they
can be candidates for connection pooling.

This assumption will not hold with batched and asynchronous queries. In
this case it is possible that the COM_QUIT is received from the client
before even the first result from the backend is read. For this to work,
the protocol module would need to track the number and state of expected
responses.
2017-08-21 10:31:07 +03:00
Markus Mäkelä
b56594470b Add persistent pool statistics
Added number of times a connection was taken from the pool as well as the
availability of the pool as a percentage of connections taken from the
pool.
2017-08-20 21:54:18 +03:00
Markus Mäkelä
e91c0fe095 Fix insufficient buffer size in maxpasswd
The buffer used to store the hexadecimal string was one byte too
short. This caused the trailing null terminator to be written into
unallocated memory.
2017-08-17 19:43:07 +03:00
Markus Mäkelä
521aff6c8f Fix out-of-bounds writes on long maxadmin commands
If a maxadmin command had more than the maximum amount of arguments, the
buffer used to store the split arguments would overflow.
2017-08-17 19:39:02 +03:00
Markus Mäkelä
fe580d272f Fix possible out-of-bounds reads in modutil_count_statements
The pointer manipulation in modutil_count_statements assumed that if a
semicolon is found, it is not the last character in the buffer. It also
assumed that the buffer contained at least one readable character.
2017-08-17 15:54:44 +03:00
Markus Mäkelä
f98d4c1dbf MXS-1365: Fix buffer reallocation in avrorouter
Buffer size calculation is now done correctly.
2017-08-17 13:39:20 +03:00
Markus Mäkelä
67386980e3 MXS-1341: Ignore binlog checksums in avrorouter
If the binlog has binlog checksums enabled, the extra checksum bytes are
removed from the end of the event. The avrorouter assumes that whatever
caused the binlogs to appear in the first place already checked that the
checksums are OK.

Also removed one extra byte being added to the length of all query events.
2017-08-16 13:24:52 +03:00
Markus Mäkelä
4210e73bf5 Create separate script for listing issues only
Having bugs and issues listed separately has its benefits over listing
everything. The same output can still be achieved by running both scripts
and concatenating their output.
2017-08-16 13:24:52 +03:00
Markus Mäkelä
24a2393a31 MXS-1363: Fix server selection algorithm in readconnroute
Servers with zero weight are now considered as valid servers by the
readconnroute connection logic.
2017-08-16 13:24:30 +03:00
Johan Wikman
af53c24106 Update version to 2.1.7 2017-08-16 12:38:34 +03:00
geaaru
3485a32731 Fix compilation errors/warning with gcc-5.4.0 (#137)
Warning are like this:
 error: ‘delimiter’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
2017-08-15 09:56:22 +03:00
Johan Wikman
7021041804 Update 2.1.6 release date 2017-08-14 10:06:27 +03:00
MassimilianoPinto
ca7aadeb24 Bingo Tutorial shows complete configuration example.
Bingo Tutorial shows complete configuration example.
2017-08-10 10:18:50 +02:00
MassimilianoPinto
87a48919e8 Release Notes 2.1.6 update
Release Notes 2.1.6 update
2017-08-10 10:10:56 +02:00
MassimilianoPinto
424c7b7ad3 MXS-1343: documentation update.
MXS-1343: documentation update for new option ‘slave_hostname’
2017-08-10 09:49:01 +02:00
Markus Mäkelä
9b9d7e4c4d Generate a list of all fixed issues
The list_fixed_bugs.sh script now also shows issues that aren't bugs.
2017-08-10 10:37:13 +03:00
Markus Mäkelä
d60df103bf Add avrorouter binlog checksum to limitations
Added a note about the avrorouter binlog checksums to the limitations
document.
2017-08-10 10:33:09 +03:00
MassimilianoPinto
7da092843f MXS-1343: send hostname to master with COM_REGISTER_SLAVE
A new option ‘slave_hostname’ allows the setting of hostname in
COM_REGISTER_SLAVE.

SHOW SLAVES HOSTS; in master server can show the hostname set in binlog
router:

MariaDB [(none)]> SHOW SLAVE HOSTS;
+-----------+-----------------------------+------+-----------+
| Server_id | Host                        | Port | Master_id |
+-----------+-----------------------------+------+-----------+
|        93 | maxscale-blr-1.mydomain.net | 8808 |     10124 |
+-----------+-----------------------------+------+-----------+
2017-08-09 17:09:50 +02:00
Johan Wikman
e409927d6c Update Changelog and Upgrading documents 2017-08-09 11:38:25 +03:00
Johan Wikman
8607f4f265 Update version number for 2.1.6 2017-08-09 11:15:19 +03:00
Markus Mäkelä
550899d909 Remove outdated limitations
The parsing limitations are no longer true.
2017-08-09 10:15:50 +03:00
Markus Mäkelä
5614e970c4 Add 2.1.6 release notes
Added 2.1.6 release notes.
2017-08-09 10:14:52 +03:00
Markus Mäkelä
238507d412 Add script for generating the list of fixed bugs
The script queries Jira for a CSV list which is transformed into a list of
Markdown links.
2017-08-09 10:11:57 +03:00
Markus Mäkelä
3cf92524f2 Add XA transactions to limitations
The lack of true XA transaction support in 2.1 is now documented in the
limitations document.
2017-08-09 09:47:08 +03:00
Markus Mäkelä
35de0c392f Only store established connections in the pool
If a connection has not been fully established (i.e. authentication has
been completed) then it should not be considered as a connection pool
candidate.
2017-08-09 09:22:57 +03:00
Markus Mäkelä
f7b8744460 Add more error messages to monitors
When the execution of a query fails, the error reported by the Connector-C
and the server where the query was executed is logged.
2017-08-03 15:42:40 +03:00
Timofey Turenko
ab82c7455c remove manual flex installation 2017-08-03 15:38:19 +03:00
Markus Mäkelä
bda1c5d55d Fix use-after-free in buffer.c
The fix to MXS-1338 added a bug where the buffer objects were freed after
the shared buffer was freed.
2017-08-02 17:55:35 +03:00
Markus Mäkelä
63b16243e7 MXS-1338: Fix memory leak of after buffer cloning
When a buffer is cloned and then the original buffer parsed and freed, the
freeing of the cloned buffer will not release the memory that was
allocated when the original buffer is parsed.

This is a side-effect of how the buffer objects are stored in the buffer
and not in the shared memory buffer. The creation of a buffer object after
cloning will cause the buffer object to be lost as the cloned buffer
didn't have a pointer to the buffer object that was created later.

By moving the buffer objects into the shared memory buffer, the memory
leak is fixed.
2017-08-02 11:09:49 +03:00
Markus Mäkelä
0dbf64b1ab Fix broken link in 2.1.5 release notes
The link to the list of issues was broken.
2017-08-01 10:50:11 +03:00
Markus Mäkelä
95c254a8b0 Update release date 2017-07-31 15:45:59 +03:00
Markus Mäkelä
931ca0f497 Stop timeout in avro_alter before fixing replication
The resetting of the replication can take some time. By disabling the
timeout during the reset, false positives are less likely.
2017-07-31 09:42:03 +03:00
Markus Mäkelä
f95fff6632 Stop replication before configuring binlogrouter
The replication needs to be stopped before the binlogrouter is started. If
the replication is stopped after this, it is possible that two servers
with the same value of server_id attempt to register as slaves which
causes the later of them to fail.
2017-07-31 09:42:03 +03:00
Markus Mäkelä
174dad4b5b Fix master server version checks in tests
The master server version was not processed adequately and false positives
of old master versions were possible.
2017-07-31 09:42:03 +03:00
Markus Mäkelä
af99ab3b72 Print the JSON in avro_alter
The test now prints the output in avro_alter. The replicate_from_master
function also stops maxscale before removing the files.
2017-07-31 09:42:03 +03:00
Markus Mäkelä
d0d19f3ded Tune timeouts for bug662
The timeouts were a bit too demanding and increasing them should lower the
rate of false positives.
2017-07-31 09:42:01 +03:00
Markus Mäkelä
fcabda15a8 MXS-1335: Disable root_node_as_master by default
Enabling the option hinders the use of maintenance mode with the root
master node in most use-cases.

This behavior occurs due to the fact that the maintenance mode causes a
server to be treted as if it was down. The Galera monitor waits for the
cluster to reorganize before assigning a new master node. This is correct
(but very unexpected) behavior for single instance use-cases.
2017-07-28 11:52:49 +03:00
Markus Mäkelä
6d9500d898 Add links to release notes in Changelog.md
The Markdown links do not work as the release note files do not exist but
the resulting KB links do work.
2017-07-28 09:47:24 +03:00
Markus Mäkelä
0256be660f Fix missing zlib in build scripts
The zlib library wasn't explicitly installed which caused it to fail on
Debian 9.
2017-07-27 16:49:45 +03:00
Markus Mäkelä
08c51aa598 Remove broken links
The links in old upgrading guides and the changelog pointed to documents
that do not exist.
2017-07-27 16:19:50 +03:00
Markus Mäkelä
86994457e1 Update 2.1.5 release notes
Added all fixed bugs and short descriptions of the major changes.
2017-07-27 16:19:50 +03:00
Johan Wikman
4985bf9b6e MXS-1328 Mark regexp functions as builtin functions
Regexp functions were not listed among the builtin read-only
functions and consequently any SELECT using one of those was
routed to master.
2017-07-27 09:58:32 +03:00
Johan Wikman
d54616f075 Update 2.1.5 release notes 2017-07-27 09:58:32 +03:00
Markus Mäkelä
448d56a273 Disable replication_manager and fix mxs1323_stress false positive
The replication_manager is only designed for systems that have yum
installed which means it will always fail on non-RHEL/CentOS systems.

The query threads in mxs1323_stress were not checking whether the test had
ended while they were executing the queries. This caused test timeouts as
the queries can take a relatively long time.
2017-07-27 09:26:27 +03:00