4856 Commits

Author SHA1 Message Date
Markus Makela
bf24f18805 Merge branch 'develop' into MXS-544 2016-02-29 10:40:33 +02:00
Markus Makela
f03865f32a Cloned DCB authentication data was freed twice
This caused all Tee filter sessions to crash when the branch DCB was closed.
2016-02-27 13:05:44 +02:00
Markus Makela
f77afc6374 Fixed possible crash when draining writequeue
The write queue spinlock was released in dcb_write_tidy_up without first
acquiring it. This caused a crash when two threads try to interact with
the write queue at the same time.
2016-02-26 20:45:41 +02:00
Markus Makela
b5b27740e3 Fixed wrong comparison being made when setting readwritesplit parameters
The comparison was done with strcmp but it was expected to return true on
success when in reality it returns 0 on success.
2016-02-26 18:06:46 +02:00
Markus Makela
87ccff097d Minor fix to token processing of dbfwfilter
The yylineno was manually simulated even though it can be automated by enabling
the yylineno option.
2016-02-26 12:30:56 +02:00
Markus Makela
784166ad0b Added missing check for fopen return value
This would have led to a crash when a NULL pointer would have been used as
a valid FILE handle.
2016-02-25 20:10:37 +02:00
Markus Makela
2c28d8c5de Removed unused functions and variables from dbfwfilter
Removed the old parsing functions which are no longer used.
2016-02-25 20:09:10 +02:00
Markus Makela
f8d74dd7e2 Cleaned up error logging for session creation failures
The old message logged the function name and thread ID which are not useful
to the end user. The thread ID should only be printed for debugging purposes,
not general error messages.
2016-02-25 18:52:22 +02:00
Markus Makela
18526c28f6 MXS-589: Separated persistent and temporary data directories
Both the passwords and temporary files of the embedded library were stored
in the same directory. Now the directories are separated and the embedded
library uses the temporary directory. The datadir cleanup also now only
cleans up the temporary data directory.
2016-02-25 11:24:20 +02:00
Markus Makela
7b8200eec0 Fixed build failures with older versions of Bison
Older versions of Bison don't include the yyparse function in the generated
header and use deprecated options.
2016-02-25 09:32:04 +02:00
Markus Makela
13387485f6 Added 'auth_all_servers' to service parameters if it is defined
The schemarouter checks if the service has this parameter and if it
is not there, it is automatically enabled. The parameter was not
added as a qualified service parameter so the router couldn't see
the parameter as defined even if it was.
2016-02-25 09:32:04 +02:00
Markus Makela
57af3e3e24 Added support for older Bison versions
The older versions of Bison use the deprecated versions of various options.
The automatic prefixing of tokens is not present in older versions so to
accommodate for this, all tokens were manually prefixed.
2016-02-25 09:32:04 +02:00
counterpoint
c26b5a3dd0 Tidy earlier fix and apply another - both follow the principle of not removing the link from session to client DCB when dcb_close is called for client DCB. The close will not fully complete, but will be finalised when the session is freed. At this time, no DCBs will be referring to the session. These measures protect the dcb->data in the client DCB from being lost until the session is no longer needed. 2016-02-24 15:34:02 +00:00
counterpoint
a61b70a810 Quick fix to see if we can overcome crash. 2016-02-24 15:18:44 +00:00
counterpoint
5122777829 Try to fix problem if balancing free client DCB and free session so that auth data is always available and client DCB is not freed until session is ready to be freed. Also fix problem in auth logic. 2016-02-24 10:00:45 +00:00
Markus Makela
cb2e3b898e Cleaned up qlafilter, topfilter and namedserverfilter instance creation
The change fixes a crash when no filebase parameter is given for the filter.

The instance creation functions of these filters had spossible memory leaks in
case errors in the configuration occurred. In addition to these, they would be
successfully created even if unexpected parameters were given.
2016-02-23 21:45:31 +02:00
Markus Makela
aec1310c52 MXS-580: Added more options for filters
The tee, qlafilter, namedserverfilter and topfilter now support the same filter
options: case, ignorecase and extended. The extended filter option enables
the Extended Regular Expression syntax for the filters which is used when
matching queries.
2016-02-23 20:52:53 +02:00
Markus Makela
19356be848 Updated documentation about Bison and Flex dependency
The dbfwfilter now requires Bison and Flex to be built
2016-02-23 20:52:52 +02:00
Markus Makela
ac3adf820b Fixed internal test failures
The tests failed due old style initialization of the embedded server. This is
fixed by using the new qc_init and qc_thread_init functions.
2016-02-23 14:54:02 +02:00
Markus Makela
417380ab83 Added missing use_priority to list of valid parameters
This caused Galera node priority usage to always fail.
2016-02-23 14:48:55 +02:00
counterpoint
395cbdc103 Simplify handling of "client data" by having a pointer to it only in DCB and not in session structure. Change name of session->client to session->client_dcb for greater clarity. Temporary free of client data in DCB, to be moved to authenticator when it becomes a module. Fix incorrect name of listener_alloc. 2016-02-23 11:13:21 +00:00
Markus Makela
1adbe3b23a No user definitions in dbfwfilter rules is treated as an error again
The lack of user definition lines in the dbfwfilter rule file was ignored
previously but this change makes the lack of users an error again. Also
added function documentation to some of the functions.
2016-02-23 10:34:12 +02:00
counterpoint
ef8a20cceb Fix silly mistakes. 2016-02-22 11:16:51 +00:00
counterpoint
5077933e41 Fix bug in mysql_client.c (over optimisation of protocol setting); various clarifications and improvements re code review. 2016-02-22 11:05:02 +00:00
Markus Makela
8e010d2367 Fixed wrong comparison being made when setting readwritesplit parameters
The comparison was done with strcmp but it was expected to return true on
success when in reality it returns 0 on success.
2016-02-22 11:05:34 +02:00
Markus Makela
28bd7c2202 Merge branch '1.2.1-binlog_router_trx' into develop 2016-02-19 18:51:59 +02:00
Markus Makela
fec1ebe925 Removed restrictions on monitor timeouts
The monitor timeouts can now be larger than the monitor interval. This will
allow the combination of low monitoring intervals and large network timeouts.
If a network experiences some periodic lag, it is desirable to allow large
timeout values.
2016-02-19 09:57:15 +02:00
Markus Makela
a947b33769 MXS-585: Fixed buffer length instead of packet length being used in a calculation
The usage of the buffer length in the authentication success checks causes
the authentication to fail with routers that don't require statement input.
2016-02-18 18:03:21 +02:00
Markus Makela
c25ef2f72a Added missing 5.5.5- prefix to MaxScale MySQL version
The handshake was sending "MaxScale 1.3.0" as the server version which causes
some connectors to think that the version is not valid.
2016-02-18 18:03:21 +02:00
Johan Wikman
52ae676fa4 Add cast when converting to size_t from double. 2016-02-18 13:19:08 +02:00
Johan Wikman
5cfe352a8a Remove inline from function definition. 2016-02-18 11:44:59 +02:00
Markus Makela
4c3f7e320e Added configurable connector repo and tags
This allows different versions and repositories to be used when building
the MariaDB connector.
2016-02-17 20:42:11 +02:00
Markus Makela
effa2dbdae Set dbfwfilter maturity to GA and set the version to 1.1.0
The module has been GA for a while and it has also changed so the version
should be updated.
2016-02-17 10:59:26 +02:00
Markus Makela
497a72d42f Added extra logging to dbfwfilter output
The real username and host is now logged in addition to the user definition
that it matched. The messages also have the service name to distinct
connections to two different services which both use the same filter.
2016-02-17 10:45:21 +02:00
Markus Makela
59f5880898 Added missing OK byte to payload size calculation
The OK byte was not taken into notice when the total size of all the payloads
in all the packets was calculated.
2016-02-17 08:30:50 +02:00
Markus Makela
47281d1c55 MXS-582: Moved to crypt_r
Replaced all calls to crypt with crypt_r.
2016-02-16 16:04:50 +02:00
Markus Makela
63ce9fe6bc Fixed formatting and added more error checks
Added log messages when ftruncate fails and cleaned up formatting.
2016-02-16 13:06:25 +02:00
Markus Makela
cd2af6ffef Cleaned up the code based on the code review
Added missing error condition checks and cleaned up code.
2016-02-16 13:06:25 +02:00
Markus Makela
a55f017c75 Fixed packets with a length of one being ignored
The packets were not written into the binlogs which caused binlog corruption.
2016-02-16 13:06:25 +02:00
Markus Makela
9306b9d68c Added detection of checksums split across two packets
The checksums should now be processed properly event if the event is in more than
one packet.
2016-02-16 13:06:25 +02:00
Markus Makela
36896afcbd Fixed missing NULL check when reading records
If the binlog record was not found, a NULL pointer is returned. There was no
check for the return value and it assumed that it was always non-NULL.
2016-02-16 13:06:25 +02:00
Markus Makela
74c8b5e296 Fixed events larger than 2^24 failing without transaction safety
If transaction safety was disabled and a large event sent in multiple SQL
packets was received, the distribution of that event to the slaves would fail.
2016-02-16 13:06:25 +02:00
Markus Makela
2b7e2d3043 Added checksum calculations for events larger than 2^24 bytes
The checksums are now properly calculated for large events that span multiple
SQL packets.
2016-02-16 13:06:25 +02:00
Markus Makela
3609f97ba0 Fixed events which are exactly 0x00fffffe bytes long failing to replicate
The empty packet sent after a large event which fits into exactly one packet
was written to disk and the writing of no bytes caused it to be treated as
an error.
2016-02-16 13:06:25 +02:00
MassimilianoPinto
476691eda1 Removed log message for event larger than 16MB
The log message used during tests is now removed
2016-02-16 13:06:25 +02:00
Markus Makela
3e04a36ac3 Added support for distribution of packets larger than 2^24 bytes
Moved the the sending of the replication events to a different function
and added support for events that span multiple MySQL packets.
2016-02-16 13:06:25 +02:00
Markus Makela
12ee568978 Fixed last_written being set to the size of the event
The addition used =+ instead of += which caused it to be an assignment.
2016-02-16 13:06:25 +02:00
Markus Makela
d2b4713d27 Added missing condition to else clause
This fixes all packets being considered as large packets.
2016-02-16 13:06:25 +02:00
Markus Makela
ae33df3cbc Large events are now processed in chuncks
The router->last_written is used to store the position where the last event was
written. The replication header is also stored in a separate structure in
the router which is used later when the last packet of a multi-packet event
arrives.
2016-02-16 13:06:24 +02:00
MassimilianoPinto
d3e1d4dd2f First fix for 16MB handling in the master part
First fix for 16MB handling in the master part.

Distribute events to up to date slave is not included yet
2016-02-16 13:06:24 +02:00