Commit Graph

2905 Commits

Author SHA1 Message Date
85d879e6ae Merge branch 'develop' into binlog_server_waitdata_encryption 2016-12-07 12:18:11 +01:00
9444ded6da Binlog encryption is now working with events larger than 16MBytes
Events larger than 16MBytes are now encrypted when being saved.

Some changes to binlog event details report and maxbinlogcheck supports
-H option for replication header display
2016-12-07 12:17:22 +01:00
0fab454e66 Close the DCB and the related backend at the same time
Closing the DCB and the backend reference that uses it at the same time
makes the error handling code clearer and removes some of the assumptions
that the code made. It will cause the DCB to be closed in multiple places
but the logic of why a DCB is being closed is more visible from the code.

This change should remove all cases where a DCB is closed without a
tightly coupled backend reference.
2016-12-07 10:48:54 +02:00
8d539d9afb Improve transaction tracking fix
The previous fix can be implemented with less changes to actual code.
2016-12-07 10:39:16 +02:00
970d70700d Close master references when they lose the master state
If the `error_on_write` mode is used when a master loses the master state,
the backend would not get closed. This would allow masters that appear
back to be used which is not intended.
2016-12-07 08:51:51 +02:00
8f86a596fa Add missing linkage to NullAuthAllow
The module did not link against the MySQLCommon library.
2016-12-06 20:27:51 +02:00
fcbea9fa40 Fix transaction tracking
If autocommit is disables, a transaction will always be open.
2016-12-06 20:27:51 +02:00
76a2475c33 Merge branch 'develop' into binlog_server_waitdata_encryption 2016-12-06 14:57:06 +01:00
9731bca42e Fix for rotate event
Fix for rotate event: missing offset results in wrong filename detection
2016-12-06 14:54:09 +01:00
4ae85dc754 Merge branch '2.0' into develop 2016-12-05 21:19:59 +02:00
b2e8a2d8c5 Develop merge
Develop merge:
this includes the new handling of events larger than 16MBytes
2016-12-05 16:38:48 +01:00
f5eb4e21dc Add more comments and clean up code
The binlog event processing code is now better commented and is slightly
easier to read.
2016-12-05 17:08:59 +02:00
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
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
d97e3587e0 MXS-878: Don't log an error for 10.1 slave connections
The error message was not needed as we know that the query is always
executed by 10.1 slaves.
2016-12-05 13:18:20 +02:00
360d7d53b8 Fix call command error message
The error messages referred to functions and printed duplicate
information.
2016-12-05 13:18:20 +02:00
a64825c866 Additions to QLA filter.
MXS-848 (partially). The QLA-filter now has additional options
to control the printing.
1. "append"
This toggles append-mode, where the filter opens the log files in
update mode (if file already existed) and only adds text to the end.
2. "print_service"
This toggles writing the service name onto each row. Mostly useful
with the unified_file-setting.
3. "print_session"
This toggles writing the session number onto each row. Mostly useful
with the unified_file-setting.

Also, the filter now writes a header to the beginning of the file
when creating it.

The printing has been separated to its own helper-function, in case
more accurate control will be added in the future.
2016-12-05 12:46:54 +02:00
943aa48fb5 Make sure DCBs are OK before closing them
Added a check for the validity of the backend DCBs before they are
closed. This should guarantee that only valid DCBs are closed by
readwritesplit.

However, this is not the correct solution for the problem. The DCB should
not be in an invalid state in the first place and this fix just removes
the bad side effects of the double closing.

With the added logging in the readwritesplit error handler, more detailed
information should become available.
2016-12-04 06:35:35 +02:00
9df3f154cf Detect duplicate objects
Creating a monitor or a listener twice is now detected and the proper
error is printed.
2016-12-03 11:31:18 +02:00
be7a315614 Exit on bad maxadmin arguments
The errors were detected but the code proceeded to call various functions
with bad pointers. This led to a crash if a bad server name was given to
'show server'.
2016-12-02 19:08:54 +02:00
a4bc575353 Remove direct freeing of sessions
Sessions are now always freed by releasing the last reference to it.
2016-12-02 15:19:44 +02:00
b2e11d41d5 MXS-536: Add option to MySQLAuth that skips authentication
Disabling authentication in MaxScale allows creation of users which act
like wildcard users but require that the connection is made through
MaxScale.
2016-12-02 14:28:58 +02:00
1d9d325a01 MXS-1026: Prevent crash with NullAuth
The authenticator module will not crash but backend authentication will
always fail.
2016-12-02 14:26:43 +02:00
6f7b572822 Only close DCBs we know are valid
If a DCB is passed to the error handler for which we cannot find the
corresponding backend reference, it should not be closed.

Added extra logging for situations where the backend reference can't be
found or it is in the wrong state.
2016-12-02 14:26:43 +02:00
bc3d6f2ac7 Change functions to commands
The module commands operations are now listed as `commands` instead of
`functions`. The output was also formatted and an optional filtering was
added to the `list commands` call.
2016-12-02 10:49:59 +02:00
3ed4ef40ba Do not use PRIu[32|64] macros in C++ code 2016-12-02 10:04:57 +02:00
582948e690 Add UINT[32|64]_MAX defines 2016-12-02 09:32:14 +02:00
f5280fecfe Fix avrouter/CMakeLists.txt
Needed to be updated when binlog was renamed to binlogrouter.
2016-12-01 15:55:25 +02:00
1707684992 Move all authenticators into separate subdirectories 2016-12-01 15:43:22 +02:00
aef6c7b099 Make directory name equal to the library name
* avro -> avrorouter
* binlog -> binlogrouter
2016-12-01 15:23:42 +02:00
a6df875495 Make filter const correct and use snake case
CamelCase is still in use with the printing functions.
2016-12-01 15:20:34 +02:00
b3e31a3da2 Add creation and destruction of monitors to maxadmin
Maxadmin can now create and destroy monitors. The created monitors are not
started as they would be useless without added servers and configuration
parameters.
2016-11-30 12:43:50 +02:00
4c4bd24a40 Allow module specific monitor parameters to be altered
Module specific parameters can now be altered at runtime. This allows both
the removal and addition of arbitrary monitor parameters.
2016-11-30 12:41:43 +02:00
24af4b3225 Clean up hintfilter
The hintfilter no longer needs to process the queries into one buffer as
the client protocol will handle that.
2016-11-30 12:37:36 +02:00
f831295847 In case of error ftruncate is called with router->binlog_position
In case of error router->binlog_position is used with truncate and
error message instead of router->last_written
2016-11-30 10:05:00 +01:00
7ac31b2674 Cache: Now implements destroyInstance 2016-11-30 10:47:24 +02:00
4ac6fe88c7 Merge branch 'develop' into binlog_server_waitdata_encryption 2016-11-30 09:38:00 +01:00
8573df6ee7 Disable concurrect maxadmin access
The administrative operations in debugcmd.c now share a global lock.
2016-11-30 10:28:23 +02:00
bfc60ae940 Remove false debug assertion
Not all routers require statement input.
2016-11-30 10:28:23 +02:00
b32af705e6 Extend routing capabilities
The routing capabilities now define the type of output the reply
processing chain expects. Currently, this only consists of two
capabilities; complete packet output and contiguous buffer output. The
latter implies the former.
2016-11-30 10:28:23 +02:00
2efa862944 Remove listmanager code
The code prevented scaling by imposing global spinlocks for the DCBs and
SESSIONs. Removing this list means that a thread-local list must be taken
into use to replace it.
2016-11-30 10:28:23 +02:00
ed280aa81b Use client DCB to route requests
Using internal DCBs for query routing wasn't needed as the client DCB
could be used. This could also be done by simply routing the query again
with routeQuery.
2016-11-30 10:28:23 +02:00
fe56e65903 Use service capabilities in response processing
The MySQLBackend protocol now only checks for complete packets if the
service requires statement based routing. This should remove unnecessary
processing when data is only streamed from the backend to the client.
2016-11-30 10:28:22 +02:00
68d3fc1092 Remove the DCB write queue locking
Since only one thread can append to the DCBs write queue at a time, there
is no need to lock it.
2016-11-30 10:28:22 +02:00
8efdaa1ea6 Move fake events to a thread-specific queue
The fake poll events are now stored in thread specific queues. This
removes the need for the poll event queue.
2016-11-30 10:28:22 +02:00
9175295542 Cache: Now also CacheRules is shared
Unnecessary methods were also removed from CachePT and CacheMT
as it does not make sense to create more than one single instance
of those per filter instance. Consequently there is no need for
them to be able to use an existing StorageFactory (and CacheRules).
2016-11-30 10:22:53 +02:00
93103fd64a Cache: shared_ptr used with CacheRules and StorageFactory
shared_ptr is now used for managing the lifetime of CacheRules
and StorageFactory instances.
2016-11-30 10:22:53 +02:00
d52145054f Cache: Now use CacheRules instead of CACHE_RULES 2016-11-30 10:22:53 +02:00
2e4ac55aa4 cache: Add CacheRules class
Easier to use in a C++ context than the C API
2016-11-30 10:22:53 +02:00
2a2c530857 Cache: Trivial cleanup of inmemory storage 2016-11-30 10:22:53 +02:00