7511 Commits

Author SHA1 Message Date
Markus Mäkelä
362234b5d2 Merge branch '2.1.7' into 2.1 2017-09-12 09:43:12 +03:00
Markus Mäkelä
4a42ddfe5f Null-terminate decrypted passwords
The decrypted passwords returned by `decrypt_password` are now properly
null-terminated.
2017-09-12 09:29:26 +03:00
Markus Mäkelä
7a8a12dd28 Update CDash drop site address
The drop site was not set to the correct one.
2017-09-12 09:29:26 +03:00
Markus Mäkelä
40f846cbb0 Add MXS-1396 into 2.1.7 release notes
The bug was included in the 2.1.7 tag but it was not in the release notes.
2017-09-12 09:28:54 +03:00
Markus Mäkelä
81202eac89 MXS-1400: Fix crash with OpenSSL 1.1
Added the missing parameter for the RSA key generation function.
2017-09-11 12:50:24 +03:00
Markus Mäkelä
9ceb23dd65 MXS-1396: Fix persistent connection hangs
When a COM_CHANGE_USER was executed, it is possible that the server
responds with a AuthSwitchRequest packet instead of an OK packet. In this
case, the server sends a new scramble which must be used to create the 20
byte hash that is expected as the response.
2017-09-11 12:50:24 +03:00
Johan Wikman
faa1cc815d Merge branch '2.1' into 2.1.7 2017-09-11 12:28:02 +03:00
Johan Wikman
5337a5092f Update release date for 2.1.7 2017-09-11 10:55:01 +03:00
Markus Mäkelä
f4cd2c62b6 Backport mxs1110_16mb fixes to 2.1
Backported changes to mxs1110_16mb from develop into 2.1.
2017-09-08 09:54:17 +03:00
Markus Mäkelä
0daa167873 Fix bug519
The test attempted to copy the generated CSV file from the MaxScale server
when in fact it was on the master server. Removed HEAVY label from the
test as it takes about 10 seconds to run.

Cherry-picked from commit f80cde2af149fda9c47d8f9131f82527b76af487.
2017-09-08 09:54:17 +03:00
Johan Wikman
db51d94b76 Update release notes 2017-09-07 10:20:35 +03:00
Johan Wikman
19cc3e67e1 MXS-1395 Allow NAMES to be used as keyword/id
NAMES is a keyword but not a reserved one. So it must be possible
to use it as an identifier as well.
2017-09-07 10:17:04 +03:00
Markus Mäkelä
e0c2af45c7 Handle AuthSwitchRequest responses to COM_CHANGE_USER
The COM_CHANGE_USER that is sent as a part of the reset process for a
persistent connection did not expect a AuthSwitchRequest packet to be sent
as that implies that the server did not take the authentication fast
path. In this case, an error message needs to be logged stating that the
server requested a different authentication plugin than was expected.
2017-09-07 09:51:23 +03:00
Johan Wikman
6794ed907a session_len must be included in assert 2017-09-06 16:41:56 +03:00
Markus Mäkelä
642232e26b Fix COM_CHANGE_USER unknown response handling
The response handling logic did not always take the last packet for
inspection when a COM_CHANGE_USER was executed. The OK packet will always
be the last one since the COM_CHANGE_USER is the last command that was
sent.
2017-09-04 17:45:30 +03:00
Johan Wikman
10de27dfa0 Update ChangeLog and Upgrading 2017-09-04 15:36:18 +03:00
Johan Wikman
c5b8bb43f8 Update release notes 2017-09-04 15:35:17 +03:00
Johan Wikman
e51a8b4fb9 Ensure that PRI formatting defines are available
On some systems, without __STDC_FORMAT_MACROS, the PRI defines
for printing 32 and 64 bit integers are not present.
2017-09-04 15:28:17 +03:00
Markus Mäkelä
862548666b MXS-1367: Enable MYSQL_OPT_RECONNECT for internal connections
The automatic reconnection feature of the Connector-C was not
enabled. Enabling it should reduce the amount of false positives that the
monitors pick up.
2017-09-04 09:19:20 +03:00
Markus Mäkelä
f9c5578bdd MXS-1384: Remove parameter length limitations
There is no reason to limit configuration parameter names or values to 256
characters.
2017-09-01 22:02:33 +03:00
Markus Mäkelä
d7662a10af MXS-1385: Fix truncation of script variables
The replacement of script variables now uses the maximum string length of
the original and replacement to make sure there's enough buffer space.
2017-09-01 21:51:15 +03:00
Johan Wikman
d0ec6e3762 MXS-1378 Log session id
If the session id is known, it will be logged together with all
messages. If present, the session id appears, enclosed in paranthesis,
right after the message category. E.g.

    2017-08-30 12:20:49   warning: (4711) [masking] The rule ...
2017-09-01 13:22:06 +03:00
Johan Wikman
61a2c960ec MXS-1378 Provide access to current session
Provide access to current session and session id. This will
be used by the logging mechanism for logging the session id
together with messages.
2017-09-01 13:20:20 +03:00
Johan Wikman
eff5e7431a MXS-1378 Provide access to the current DCB in 2.1
Conceptually this is a cherry-pick of commit
67efd1daeabbc398b8a8fbc0cd02c2af26e4cb6c (2.2), but too much has
changed to actually be able to cherry-pick that commit.
2017-09-01 13:20:20 +03:00
Markus Mäkelä
22ceac6676 Update alter server help text
Added `persistpoolmax` and `persistmaxtime` to the help output of `show
servers`.
2017-09-01 12:06:44 +03:00
Markus Mäkelä
8e0a35528b Add 2.1.7 release notes
Added 2.1.7 release notes.
2017-09-01 12:04:50 +03:00
Markus Mäkelä
7cef722282 Handle unexpected responses to COM_CHANGE_USER
When an unexpected response to a COM_CHANGE_USER is received, it is now
processes and discarded instead of treated as an error. This will allow
further analysis of the situation in addition to possibly solving some of
the problems that the persistent connections have.

Added extra info level logging to relevant parts of the code that deal
with the COM_CHANGE_USER reply processing. This information should allow
tracking of the response state for debugging purposes.
2017-09-01 11:28:21 +03:00
Markus Mäkelä
63c803a818 MXS-1379: Route conflicting queries to current shard
All conflicting queries are routed to the shard which contains the
currently active database.
2017-09-01 11:28:21 +03:00
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