Commit Graph

1608 Commits

Author SHA1 Message Date
e9bcb3c7e0 Remove deprecated logging functionality 2017-02-14 11:19:30 +02:00
825782799f Zendesk's Maxwell Compatibility (#119)
* Binlog router: Introduce maxwell_compatibility flag

* Binlog router: Handle 'server vars' query

This is a step towards using MaxScale with Zendesk's Maxwell.

* Binlog router: Handle results charset query

* Binlog router: Handle sql_mode query

* Binlog router: Handle server_id query

* Binlog router: Handle 'binlog vars' queries

* Binlog router: Handle @@lower_case_table_names query

* Binlog router: Handle @@global.binlog_checksum query

* Binlog router: DRY Maxwell SQL queries
2017-02-13 16:40:01 +01:00
f9732d7041 Fix DECIMAL handling in Avrorouter
The DECIMAL value type is now properly handled in Avrorouter. It is
processed into an Avro double value when before it was ignored and
replaced with a zero integer.

Backported to the 2.0 branch.
2017-02-13 16:23:26 +02:00
4bd743d3ce Use correct Avro function
The avrorouter used the 32-bit function to store 64-bit integers. This
caused incorrect values to be stored.
2017-02-13 16:23:26 +02:00
0b892c9714 Add missing newline to avrorouter output
The schema was not terminated with a newline.
2017-02-13 16:23:22 +02:00
10e74225c0 Add missing error detection
If the file fails to seek to the correct position, the indexing should
stop.
2017-02-13 16:18:43 +02:00
7e23789364 Fix one last compilation error
Fix one ignored return value in Avro, caused compilation to fail.
2017-02-13 14:46:43 +02:00
acd66b4eb3 Fix compiler warnings
Added missing checks for return values of various function calls. Fixed
binlogrouter strerror_r usage and wrong buffer sizes.
2017-02-13 11:44:38 +02:00
eb1e163bdf Only update index file if file is flushed to disk
There's no point in indexing the file if it hasn't been synced to
disk. Any attempts to index the file will fail if the file still has an
open data block.
2017-02-12 04:38:24 +02:00
d2c3be8728 Fix compiler flag usage
The compiler flags overwrote the default values that CMake generates
instead of appending to them.
2017-02-10 17:19:46 +02:00
d25d0e9c4e Don't request and set UUID if the master server is MariaDB 10
SHOW VARIABLES LIKE 'SERVER_UUID' and SET @slave_uuid are meant only
for MySQL 5.6/7 master registration.

If MariaDB 10 compatibility is set then skip these useless requests.
2017-02-10 10:33:40 +01:00
47a1cdad5d Fix binlog integer conversion
The binlog integers were stored as unsigned values instead of signed ones.
2017-02-09 16:01:03 +02:00
54d4a562ce Merge branch '2.1' into develop 2017-02-09 15:07:13 +02:00
ce5cd69eb3 Remove unused locks and variables
Removed unused spinlocks from DCBs, sessions and the MySQL protocol
structs. They were used in a context where only one thread has access to
the structure.

Removed unused member variables from DCBs.
2017-02-08 15:31:17 +02:00
5cd29c4220 Merge branch '2.1' into develop 2017-02-08 09:32:18 +02:00
a6698c6f07 Merge branch '2.1.0' into 2.1 2017-02-08 09:30:34 +02:00
c82831cc10 Fix merge conflict
An old define name caused the build to fail.
2017-02-08 09:29:26 +02:00
67888f3596 Merge branch '2.0' into 2.1.0 2017-02-08 09:27:00 +02:00
7149775163 Use correct enum values in avrorouter
The file flushing enums weren't used.
2017-02-07 10:21:58 +02:00
d61f0d0afd Remove useless debug assertion
The debug assertion assumes that the table definition is always in the
binlogs. If a binlog row event without a table definition is read, debug
versions would crash even though the situation is acceptable and expected.
2017-02-07 10:21:58 +02:00
c6e1705f8d Add diagnostic entry point to authenticators
The authenticators should have a similar way to print diagnostic
information as filter and routers do. This allows the authenticators to
print the users in their own format.

In the future, all the diagnostic entry points should be changed so that
they return a structure that contains the information in a standard
form. This information can then be formatted in different ways by other
modules.
2017-02-07 10:03:58 +02:00
c0f5124f6f Fix field name parsing in avrorouter
The backtick was copied to the field name and converted to an underscore
when the name was transformed into a valid Avro identifier. This caused
one extra character to appear in the field name in the Avro schema files.
2017-02-06 16:35:40 +02:00
869e6ac950 Remove useless maxadmin commands
The commands did nothing.
2017-02-06 10:29:10 +02:00
a5a579ffce Rename BUILD_AVRO to BUILD_CDC
Using the broader CDC name instead of AVRO for the CMake variable name
makes more sense as there are modules other than the avrorouter.
2017-02-03 14:39:56 +02:00
6ee257dc5f Only log an error if the binlog file exists
The avrorouter logged an error every time it tried to open a file even if
the file doesn't exist.
2017-02-03 08:16:12 +02:00
e64a641bcd Merge branch '2.0' into develop 2017-02-01 09:35:13 +02:00
122027e4a3 Fix binlogrouter test
The test used the wrong working directory. blr_slave.c didn't check the
input for NULL values.
2017-01-30 16:46:24 +02:00
7dc5698c90 Rename domain to module
The module commands now use the module name as the replacement for
domain. The domain itself wasn't any better when compared to the module
name.
2017-01-28 10:09:34 +02:00
e8c53e8aa5 Fix authenticator path in testbinlog.c
Added missing subdirectories in library path
2017-01-27 15:12:06 +01:00
1f9b18e3bc Split secrets.h to public and core + miscellaneous cleanup
Also, changed some function names to this_style from thisStyle. More of
this in later commits.
2017-01-27 15:33:52 +02:00
50cffed5b2 Add readwritesplit options to diagnostic output
This helps detect the state of the loaded configuration.
2017-01-27 12:19:27 +02:00
8a1a4c91e4 Enable disable_sescmd_history by default
The combination of the default values of `disable_sescmd_history=false`
and `max_slave_connections=100%` does not make sense as it is not possible
to find a replacement slave in case an active one fails.
2017-01-27 12:19:27 +02:00
8b83bf834e Clean up router.h
Nothing moved to core, just rename and cleanup.
2017-01-26 16:14:17 +02:00
74225daf46 Remove memlog and rdtsc
Neither of these were actively used, so they and any associated tests
were removed.
2017-01-26 13:16:51 +02:00
8d07604436 Split maxscale.h to public and private parts
This header defines some general functions and maxscale main() return
values. Most of it is still public, but there were some functions
which were moved to a core header.
2017-01-26 11:17:25 +02:00
84040be182 Add missing error handling to Avro file handling
Some of the JSON errors weren't handled which could cause problems when a
malformed schema definition is read.

Also added more error messages for situations when opening of the files
fails.
2017-01-26 10:23:26 +02:00
3378edc4d3 Route COM_SET_OPTION to all servers
This fixes problems with multi-statement execution which is only enabled
when the corresponding option is present.
2017-01-26 09:57:29 +02:00
aa8851fbe1 Remove listmanager
The file wasn't used, so any traces of listmanager.h or .c have been
erased.
2017-01-25 16:11:12 +02:00
7d51864402 Clean config.h some more
Moved some typedefs to router.h and server.h, changed a few
constants to these enums. Renamed some types in config.h to
remove "Gateway".

There are still some functions in the public header which are
only used in core, but they seem to fit the theme of public functions
so were not moved.
2017-01-25 16:05:51 +02:00
b923589222 Fix relaxed multi-statement mode
The relaxed mode for multi-statements wasn't working as it required the
configuration to be enabled.
2017-01-25 15:39:10 +02:00
a1f54366c0 Fix compilation error
Fix compilation error
2017-01-25 14:27:21 +01:00
be7344f747 MXS-185: "read-only" transactions detected in readwritesplit handleError
handleError can detect READ ONLY transaction set when problem_dcb ==
rses->forced_node->bref_dcb.

Session will be closed and rses->forced_node set to NULL
2017-01-25 12:58:10 +01:00
b23d3e6198 MXS-185: "read-only" transactions to be directed to the slaves by the readwritesplit router
START TRANSACTION READ ONLY
statements
COMMIT

All statements, including START … and COMMIT are routed to same slave
server
2017-01-25 11:43:17 +01:00
b187afdcf4 Move config_runtime.h and externcmd.h to core
+ some cleanup
2017-01-24 13:05:21 +02:00
8cffa4ad58 Divide poll.h to core and public headers
Also some cleanup of other headers.
2017-01-20 17:15:27 +02:00
6e38276a20 Rename files, removing "gw"-prefix
Also gwdirs.h.in -> paths.h.in
2017-01-20 12:55:52 +02:00
eff34b91fb Move modules.h to core/maxscale
Also remove some unnecessary includes + cleanup
2017-01-19 15:53:25 +02:00
53c5b475ad More cleanup of monitor.h
Move some more functions into core header + miscellaneous cleanup
2017-01-19 15:32:40 +02:00
02a8f7492e Divide session.h to internal and interface headers
Definitions and function used by core are in
server/core/maxscale/session.h
Definitions and function used by plugins are in
include/maxscale/session.h
2017-01-19 15:19:40 +02:00
8aa76727d2 Remove explicit long indicator of size defines 2017-01-19 10:42:05 +02:00