107 Commits

Author SHA1 Message Date
MassimilianoPinto
f13410bae9 MXS-1209: added SELECT @@GLOBAL.gtid_domain_id for Master GTID registration
Master GTID registration: added first step: support for “SELECT
@@GLOBAL.gtid_domain_id”
2017-05-03 14:46:41 +02:00
Johan Wikman
fae4b2d99a MXS-1209: Ensure master is connected to in main worker 2017-04-27 18:05:22 +02:00
MassimilianoPinto
9a34aa5c7f Fprintf removed
Fprintf removed
2017-04-27 18:03:34 +02:00
Johan Wikman
a4f9beb1ad MXS-1209: Ensure master is connected to in main worker 2017-04-27 11:00:07 +03:00
MassimilianoPinto
1e98de7b15 Added extra debug fprintf
Added extra debug fprintf
2017-04-27 09:15:32 +02:00
Markus Mäkelä
5704ae5ffd Allow paths to be created if they don't exist
A module can now declare a path parameter for a directory that does not
yet exist. If the directory does not exist, MaxScale will create the
directory with the requested permissions.
2017-04-20 13:26:16 +03:00
Markus Mäkelä
ad1c05b015 Merge branch '2.1' into develop 2017-04-05 11:35:13 +03:00
Markus Mäkelä
cbc1e864d9 Use RFC 3986 compliant addresses in log messages
When log messages are written with both address and port information, IPv6
addresses can cause confusion if the normal address:port formatting is
used. The RFC 3986 suggests that all IPv6 addresses are expressed as a
bracket enclosed address optionally followed by the port that is separate
from the address by a colon.

In practice, the "all interfaces" address and port number 3306 can be
written in IPv4 numbers-and-dots notation as 0.0.0.0:3306 and in IPv6
notation as [::]:3306. Using the latter format in log messages keeps the
output consistent with all types of addresses.

The details of the standard can be found at the following addresses:

     https://www.ietf.org/rfc/rfc3986.txt

     https://www.rfc-editor.org/std/std66.txt
2017-03-31 14:12:58 +03:00
Markus Mäkelä
509a5c6ed3 Fix error handling for binlogrouter
The binlogrouter error handling closed the DCB twice. This was caused by
the change in the way the DCB error handling is done.

The protocol modules now also call the error handling routine even if the
router session is NULL. This enables the binlogrouter to manage
authentication failures correctly instead of trying to reconnect again.
2017-03-31 14:11:46 +03:00
MassimilianoPinto
a236b14eef MXS-1075: Sqlite db for GTID - file, pos mapping
Use sqlite3 database instead of hash tables for GTID - file, pos mapping
2017-03-28 10:23:09 +02:00
MassimilianoPinto
72c2a3ca18 Merge branch 'develop' into MXS-1075 2017-03-27 08:38:07 +02:00
Markus Mäkelä
039f6e3487 Take static module capabilities into use
The static module capabilities are now used to query the capabilities of
filters and routers. The new RCAP_TYPE_NOAUTH capability is also taken
into use. These changes removes the need for the `is_internal_service`
function.
2017-03-20 11:10:08 +02:00
Markus Mäkelä
1736aca7f7 Add module level static capabilities
The static capabilities declared in getCapabilities allows certain
capabilities to be queried before instances are created. The intended use
of this capability is to remove the need for the `is_internal_service`
function.
2017-03-20 11:10:08 +02:00
MassimilianoPinto
9388dff7cf Merge branch 'develop' into MXS-1075 2017-03-15 18:12:00 +01:00
Markus Mäkelä
147a1f88eb Merge branch '2.1-ipv6' into develop 2017-03-13 13:18:08 +02:00
Markus Mäkelä
37dd561470 Add support for IPv6
Both the listeners and servers now support IPv6 addresses.

The namedserverfilter does not yet use the new structures and needs to be
fixed in a following commit.
2017-03-13 10:45:55 +02:00
MassimilianoPinto
cb69b3cbca Merge branch 'develop' into MXS-1075 2017-03-09 15:08:04 +01:00
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