90 Commits

Author SHA1 Message Date
Markus Mäkelä
e1a1959bc2 Replace strerror_r with mxs_strerror
The mxs_strerror function requires no local buffer, thus making it simpler
and cleaner to use.
2017-03-09 09:36:57 +02:00
MassimilianoPinto
670150c1c9 MXS-1075: added blr_fetch_mariadb_gtid() routine
Added generic blr_fetch_mariadb_gtid() routine

inst->binlog_name is now stored into MARIADB_GTID_INFO struct. (it was
missing)
2017-03-08 09:06:10 +01:00
MassimilianoPinto
656a38096c Revert "MXS-1075: added blr_fetch_mariadb_gtid() routine"
This reverts commit b0afff73a1b9b1eacc617408d92d5117b7676f0e.
2017-03-08 08:57:59 +01:00
MassimilianoPinto
e8161bbb08 MXS-1075: MARIADB_GTID_INFO struct is fully copied
Binlog file in MARIADB_GTID_INFO is now duplicated
2017-03-08 08:57:43 +01:00
MassimilianoPinto
b0afff73a1 MXS-1075: added blr_fetch_mariadb_gtid() routine
Added generic blr_fetch_mariadb_gtid() routine

inst->binlog_name is now stored into MARIADB_GTID_INFO struct. (it was
missing)
2017-03-08 08:51:19 +01:00
MassimilianoPinto
8bacc91153 Merge branch 'develop' into MXS-1075 2017-03-07 16:11:18 +01:00
Markus Mäkelä
f18a40ce73 Remove redundant error handling code from routers
The routers no longer need to track the number of errors each DCB
receives. This is now done by the protocol modules.

The type of the DCB no longer needs to be checked in the handleError
implementation as the function is only called when a backend DCB fails.
2017-03-07 11:12:56 +02:00
MassimilianoPinto
0f9c169e7d Merge branch 'develop' into MXS-1075 2017-03-06 08:57:51 +01:00
MassimilianoPinto
4e8bf1106b MXS-1075: MariaDB 10 Slave registration with GTID
New SQL commands are handled for MariaDB 10 slave registration with GTID
2017-03-06 08:56:26 +01:00
Johan Wikman
b3e8ea9b5a Merge branch '2.1' into develop 2017-03-03 13:37:14 +02:00
MassimilianoPinto
1061344de9 MXS-1075: save all received MariaDB GTIds
The GTID saving, which will allow slave to connect with GTID, is done
only with transaction_safety = on
2017-03-02 13:07:21 +01:00
MassimilianoPinto
054ddcb3dd MXS-1075: pending_transaction struct added
New pending_transaction added and master_transaction_t values are now
used in all files
2017-02-28 13:50:38 +01:00
Johan Wikman
560bd1e507 Update MXS_ROUTER_OBJECT APIs
Now the type MXS_ROUTER_SESSION is used in MXS_ROUTER_OBJECT.
All routers updated accordingly.
2017-02-27 10:17:57 +02:00
Markus Mäkelä
68f99ae305 Remove unused DCB callback code
The highwater and lowwater callbacks were never registered for the client
DCBs in the binlogrouter.

The DCB hangup callbacks were never called by the core and were replaced
with fake hangup events in an earlier version.
2017-02-27 09:25:15 +02:00
MassimilianoPinto
755a3601ec MXS-1141: maxbinlogcheck to replace an event with ignorable event
maxbinlogcheck utility can replace an event at pos with an ignorable
event

New option is -R, —replace

-R $pos

The -R needs -f as file will be modified
2017-02-16 12:23:26 +01:00
MassimilianoPinto
a0b599730c Detect and store MariaDB GTID
If Binlog Server is running with MariaDB 10 compatibility then the
found GTID is stored in router->mariadb_gtid
2017-02-15 08:29:38 +01:00
Johan Wikman
71707c8505 Merge branch '2.1' into develop 2017-02-15 08:48:36 +02:00
Johan Wikman
49cc2b52e3 Merge branch '2.1.0' into 2.1 2017-02-15 08:44:55 +02:00
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Johan Wikman
0838401b32 Merge branch '2.1' into develop 2017-02-14 17:54:27 +02:00
Johan Wikman
2a49cd6451 getCapabilities now get the instance as argument
Allows the capabilities to be different depending on how the
filter/router has been configured.
2017-02-14 13:55:22 +02:00
Adam Szkoda
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
Esa Korhonen
8b83bf834e Clean up router.h
Nothing moved to core, just rename and cleanup.
2017-01-26 16:14:17 +02:00
Esa Korhonen
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
Esa Korhonen
fb771c8a2e Rename public types and constants in session.h
Preparing to split session.h into module and core sections.
2017-01-17 16:30:14 +02:00
Markus Mäkelä
a48be9badf Format router modules
Formatted router modules with Astyle.
2017-01-17 14:48:43 +02:00
Markus Mäkelä
2cabcea211 Add definitions of MXS_MODULE_NAME to all modules
All modules now declare a name for the module. This is name is added as a
prefix to all messages logged by a module. The prefix should help
determine which part of the system logs a message.
2017-01-16 11:28:34 +02:00
Markus Mäkelä
c06a95ff92 Use module parameters in binlogrouter
The binlogrouter accepts all router options also as parameters.
2017-01-10 16:52:29 +02:00
Johan Wikman
a2a38f952a Add [process|thread] [init|finish] functions to modules
The MXS_MODULDE object now contains optinal pointers for functions
to be called att process and thread startup and shutdown. Since the
functions were added to the end, strictly speaking, all structures
would not have needed to have been modified, but better to be
explicit. In a subsequent change, these will be called.

C++ does not support flexible arrays, so for the time being C++
modules are restricted to 10 parameters. Better approach is to
factor out the parameters to a separate array and then just store
a pointer to that array in MXS_MODULE.
2017-01-05 14:44:02 +02:00
Markus Mäkelä
c96bd64aa8 Rename MODULE_INFO to MXS_MODULE
The MODULE_INFO is now the main object which is used by modules to convey
information to the MaxScale core. The MXS_MODULE name is more apt as it
now contains the actual module definition.

The old MODULES structure was moved into load_utils.c as an internal
implementation and was renamed so that it is not confused with the new
MODULE structure.
2017-01-03 18:01:14 +02:00
Markus Mäkelä
b00e0328d5 Create a macro for module declarations
The modules are now declared with a common macro. This allows future
additions to the module loading process while also making the loaded
symbol name a constant.
2017-01-03 18:01:13 +02:00
Markus Mäkelä
ae0577c695 Move module object inside MODULE_INFO
This allows modules to only expose one entry point with a consistent
signature. In the future, this could be used to implement declarations of
module parameters.
2017-01-03 18:01:13 +02:00
MassimilianoPinto
7454ef1d0b MXS-1064: Encryption options to "show service ..."
The binlog encryption options are reported by “show service
$service_name” of binlog router if the encryption is enabled.
2016-12-16 08:48:36 +01:00
MassimilianoPinto
7047cdf6c6 MXS-867: Key file Key Management for binlog encryption
Binlog server option ‘encryption_key_file=’ can now use the same key
file the MariaDB 10.1 server might have  in my.cnf:
‘file_key_management_filename=‘

Note: the file content must be in clear, no key encryption.
2016-12-13 15:51:43 +01:00
MassimilianoPinto
162ae04d20 MXS-867: Binlog server encryption key has same format as MariaDB key file
Default algorithm is now AES_CBC.
The MariaDB 10.1 key file cannot be read as it might contain more than
1 rows.
2016-12-12 14:01:54 +01:00
Markus Makela
106f482f45 Add result set buffering to MySQLBackend
The backend MySQL protocol module now supports a new routing capability
which allows result sets to be gathered into one buffer before they are
routed onward. This should not be used by modules that expect large
result sets as the result set is buffered in memory.

Adding a limit on how large of a result set could be buffered would allow
relatively safe use of this routing capability without compromising the
stability of the system.
2016-12-12 10:48:53 +02:00
MassimilianoPinto
b2e8a2d8c5 Develop merge
Develop merge:
this includes the new handling of events larger than 16MBytes
2016-12-05 16:38:48 +01:00
Markus Makela
2f082cb7fb Store large events in memory
Storing the large events in memory allows checksum calculations to be done
in one step. This also makes the encryption of events easier as they
require the complete event in memory.
2016-12-05 17:08:59 +02:00
Markus Makela
83109a6e9e Use protocol module to process packets
The backend protocol module can be requested to provide complete and
contiguous packets to the router module. This removes the need to process
the packets in binlogrouter.
2016-12-05 17:08:59 +02:00
Johan Wikman
aef6c7b099 Make directory name equal to the library name
* avro -> avrorouter
* binlog -> binlogrouter
2016-12-01 15:23:42 +02:00