Commit Graph

1529 Commits

Author SHA1 Message Date
3870b81244 Prevent unintentional reconnections to the master server
If a master_failure_mode was set to error_on_write, a reconnection to the
old master would happen after the following events:

- Master server fails and the connection is closed
- The master server recovers
- A slave fails and the connection is closed
- A replacement for the slave is searched

If these events took place, the master would be taken back into use with
an inconsistent session state.
2016-11-02 19:55:36 +02:00
ab487e687f qc: Remove QUERY_IS_TYPE macro
Explicit call to qc_query_is_type() instead.
2016-11-02 15:50:21 +02:00
572d466fad Fix read-only mode error handling in readwritesplit
In read-only modes, readwritesplit would always continue even if an active
statement execution was in progress.
2016-11-02 12:12:36 +02:00
37a2c8cecf Use new function name in blr_slave
The blr_file_use_binlog function no longer exists and blr_file_append
should be used instead.
2016-11-01 10:28:15 +02:00
a9f7e4ac6f Merge branch 'develop' into binlog_server_mariadb_master_encryption 2016-10-31 15:49:48 +01:00
7dd498f0b9 MXS-958: a new binlog file is created after CHANGE MASTER if there is… … no pending transaction
Binlog server is already configured: if there is no pending transaction
a new binlog file is created after CHANGE MASTER.

If as START SLAVE is issued replication starts as usuale.

If maxscale is restarted the replication starts using the new created
file.
2016-10-31 15:20:51 +01:00
69b8cef95c MXS-958: the specified binlog file is created in $binlogdir while configuring binlog server for the first time
While configuring binlog server for the first time, master.ini not
existent, the specified MASTER_LOG_FILE is created in the $binlogdir.

If START SLAVE command is not issued the replication can start after
restarting maxscale as the binlog file exists.
2016-10-31 15:14:23 +01:00
6835fe4db9 Use pre-2.1 freeing functions
The binlogrouter code used the new MXS_FREE macro from the 2.1 version.
2016-10-31 14:56:20 +02:00
5ca0c730a1 MXS-960: In BRL, accept passwords with "," in them.
strtok_r replaced with a function that ignores delims that appear
within any of the MySQL quotes.
2016-10-31 11:54:15 +02:00
01f3b35fad MXS-961: error in replication stream and checksum calculation
When checksum is in use and there is an error in replication stream
master connection the blr_terminate_master_replication has no effect.

MXS-961: The checksum detection calls
blr_master_delayed_connect(router); and connection is scheduled again.

The fix will break the main loop as soon as the error indicator byte is
seen and no other computation will be done (such as checksum)
2016-10-31 10:18:22 +02:00
0f68fa6028 Removing error messages while executing RESET SLAVE
Removing error messages while executing RESET SLAVE
2016-10-28 18:40:18 +03:00
1388686fb7 MXS-957: Fix temporary table detection
Temporary tables which were created from joins with other temporary tables
weren't properly detected as CREATE TEMPORARY TABLE statements.
2016-10-26 17:36:48 +03:00
dc97de57c2 qc: Some minor cleanup
- qc_types_to_string renamed to qc_typemask_to_string
- qc_get_qtype_str removed, duplicate of qc_typemask_to_string
2016-10-26 10:21:11 +03:00
3915b4e7c7 Exclude MXS_DEBUG in release builds
Now, MXS_DEBUG turns into a nop in release builds.
2016-10-24 14:00:51 +03:00
d961864635 Fix tests and limit internal test set size
Some of the tests depended on a working installation where modules are all
located at the default paths. These tests now explicitly set the module
directory which fixes the immediate problem.

Disabled the starting of services in the service test as this will fail
with real modules. The dummy internal modules aren't build and should be
removed in a later commit. In general, it might be better to do service
level testing outside the internal test suite.
2016-10-24 13:16:59 +03:00
db2cccbd8f Replace getCapabilities() with getCapabilities(void)
The latter means no args, the former means any args.
2016-10-24 11:19:43 +03:00
59a4152d8a Add getCapabilities to filters
Common capabilities are now defined in routing.h. The common
capabilities can be defined using bits 0 - 15.

Router capabilities are defined using bits 16-31 and filter
capabilities (should there ever be such) using bits 32-47.

So, to find out the capabilities of a service you only need to
OR the capabilities of the router and all filters together.

For instance, if a single filter needs statement based routing,
then that is what is done.
2016-10-24 11:19:43 +03:00
4e07c3313c Move dbusers.c out of the core
The dbusers.c was a MySQL protocol specific file which was used directly
by some of the modules.

Added a new return value for the loadusers authenticator entry point which
allows fatal failures to occur when users are loaded. Currently this is
only taken into notice when the service is first started. If a listener
later returns a fatal error, it is only logged but the service stays in
operation.

Moved the MySQLAuth authenticator sources and the tests that relate to
this module into a subdirectory in the authenticator
directory. Eventually, all authenticators could have a subdirectory of
their own.
2016-10-21 18:33:35 +03:00
fe689504b0 Move service user injection into MySQL authenticator
The MySQL authenticator now injects the service user into the list of
allowed users if loading of database users fails. This allows the removal
of common code in the binlogrouter and maxinfo modules.
2016-10-21 18:33:35 +03:00
6bcb3ce4dc Change capabilities to uint64_t
- Since the capabilities are a bitmask, it is better if an unsigned
  integral type is used.
- Since the function is part of an ABI, it is better if an explicit
  size is used.
- 64-bits so that there also is room for independent filter
  capabilities.
2016-10-20 20:14:59 +03:00
48b1583830 Add FindJansson.cmake
Added find_package module for CMake which locates the Jansson libraries
and headers. This will make dependency checking easier and prevents build
failures due to missing dependencies.
2016-10-19 09:35:09 +03:00
8d92e295d8 Fixed wrong constant name
Fixed wrong constant name
2016-10-17 15:29:20 +02:00
cf3be88c75 Merge branch 'develop' into binlog_server_mariadb_master_encryption 2016-10-17 12:20:23 +02:00
15de0a0fb3 COM_QUIT handler in binlog server now returns 1
COM_QUIT handler in binlog server now returns 1.
2016-10-17 12:16:47 +02:00
f0cf391c18 include/maxscale/gw.h removed.
In a subsequent change, the includes of server/core/*.c will be
cleaned up, and if there is a common set of include files, needed
by most, then a server/core/maxscale/core.h that includes those
will be introduced.
2016-10-17 12:17:09 +03:00
b27774e674 Rename MAX_BUFFER_SIZE
MAX_BUFFER_SIZE, which is used for limiting the amount of the data
read from a socket renamed to MXS_MAX_NW_READ_BUFFER_SIZE and moved
from gw.h to limits.h.

Consider removing altogether. Difficult to justify since non-blocking
reads are used and the amount of available data is known.
2016-10-17 12:17:09 +03:00
3ce501a975 Merge branch 'develop' into binlog_server_mariadb_master_encryption 2016-10-17 10:32:41 +02:00
b50e794be7 MXS-917: Only log an error if the master is in use
When the readwritesplit can't locate the master server when it's checking
the list of available servers, it logs an error if the original master
reference isn't in a valid state. This error should only be logged if the
server is in use but in an unexpected state.
2016-10-17 06:54:37 +03:00
1333da0712 Remove skygw_utils.h
The general purpose stuff in skygw_utils.h was moved to utils.h
and the corresponding implementation from skygw_utils.cc to utils.c.
Includes updated accordingly.

Skygw_utils.h is now only used by log_manager and by mlist, which
is only used by log_manager. Consequently, skygw_utils.h was moved
to server/maxscale.

Utils.h needs a separate overhaul.
2016-10-14 19:50:54 +03:00
a9e00473c1 Merge branch 'develop' into binlog_server_mariadb_master_encryption 2016-10-14 15:48:22 +02:00
ba97361c02 Hole detection code review update
Hole detection code review update
2016-10-14 15:46:25 +02:00
03dbc6df80 Remove dependency on skygw_utils.h
- STRERROR_BUFLEN moved to cdefs.h and renamed to MXS_STRERROR_BUFLEN.
  Better would be to provide a 'const char* mxs_strerror(int errno)'
  that would have a thread specific buffer for the error message.
- MIN and MAX also moved to defs.h as MXS_MIN and MXS_MAX.
- Now only mlist.h of the headers depend upon skygw_utils.h.
2016-10-14 15:42:02 +03:00
bff2cfb7e5 Remove skygw_types.h
Some stuff moved to maxscale/utils.h. Further cleanup still needed.
2016-10-14 14:24:31 +03:00
0800bf4a59 Rename skygw_debug.h to debug.h
Also remove unneded includes in debug.h
2016-10-14 13:48:10 +03:00
a30782227b Hole detection while receiving events and maxbinlogcheck support for encrypted binlog files
When a hole is detected while receiving events an ignorable event is
written in maxscale binlog. Such event is not sent ti slave servers.

Maxbinlogcheck can now check encrypted binlog files without decrypting
them
2016-10-14 12:20:57 +02:00
c03b8079fd Move @file comment
Where it exists, the @file comment has now been moved to be
consistently right after the license blurb.
2016-10-14 13:20:52 +03:00
1a978be6b6 Cleanup header files
- All now include maxscale/cdefs.h as the very first file.
- MXS_[BEGIN|END]_DECLS added to all C-headers.
  Strictly speaking not necessary for private headers, but
  does not hurt either.
- Include guards moved to the very top of the file.
- #pragma once added.
2016-10-14 11:54:37 +03:00
d04cb54b9f maxscale/maxscale_pcre2.h renamed to maxscale/pcre2.h 2016-10-13 22:59:39 +03:00
76430e060f maxconfig.h renamed to config.h 2016-10-13 22:59:39 +03:00
3a18b64bdd mysql_client_server_protocol.h moved.
Moved to include/maxscale/protocol/mysql.h
2016-10-13 22:59:39 +03:00
c433d11b39 Module private headers moved to modules 2016-10-13 22:59:39 +03:00
e41589be10 Move headers from server/include to include/maxscale
- Headers now to be included as <maxscale/xyz.h>
- First step, no cleanup of headers has been made. Only moving
  from one place to another + necessary modifications.
2016-10-13 16:19:20 +03:00
9d8c5cd410 MXS-862: Add authenticator options and instances
Authenticators now have a similar mechanism to the `router_options`
parameter which enables configurable authentication.

The authenticators also have a new initialize entry point which is similar
to the createInstance entry point of the filters and routers. The value of
`authenticator_options` is passed as a parameter to this function. The
return vaulue of the `initialize` entry point is passed to the `create`
entry point.
2016-10-13 15:58:18 +03:00
1cc687a8c0 Merge branch 'binlog_server_wait_data' into binlog_server_waitdata_encryption 2016-10-05 18:25:43 +02:00
3957d8561e Merge branch 'develop' into binlog_server_wait_data 2016-10-05 18:25:15 +02:00
4c82dd5032 Code review update
Code review update
2016-10-05 18:11:13 +02:00
d8f09ab4d4 Encryption context is passed to blr_read_binlog()
Encryption context has been removed from BLFILE struct and is now
passed to blr_read_binlog()
2016-10-04 17:32:06 +02:00
e5b34e30ae Code review update
Code review update
2016-10-04 09:20:03 +02:00
fbf5c331f1 Merge branch '2.0.1' into develop 2016-10-03 15:21:04 +03:00
dcc38b44a9 The first_enc_event_pos was not set in one case
The first_enc_event_pos was not set in one case
2016-10-03 11:41:57 +02:00