Commit Graph

3243 Commits

Author SHA1 Message Date
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
2423031df8 Cache: Use lock guard for locking spinlocks
Now the locks will always be release, also in the presence of an
unantecipated exception.
2016-11-30 10:22:53 +02:00
efa8713b17 Cache: Include inmemory storage in build
Add logging note to storage_rocksdb at the same time.
2016-11-30 10:22:53 +02:00
23bb7c4de7 Cache: Add in memory storage
Storage implementation that simply uses std::unordered_map as
storage structure.
2016-11-30 10:22:53 +02:00
e5a9eceff4 Cache: Fix prev/next twiddling 2016-11-30 10:22:53 +02:00
9c1b9c188e Cache: Enable LRU eviction
The maximum count and maximum size of the cache can now be
specified and a storage can declare what capabilities it has.
If a storage modile cannot enforce the maximum count or maximum
size limits, the storage is decorated with an LRU storage that
can.
2016-11-30 10:22:53 +02:00
e597523c47 Cache: Allow storage modules to specify capabilites
Will be used to decide whether a LRUStorage facade is needed in front
of the actual storage or not.
2016-11-30 10:22:53 +02:00
1701979696 Cache: Add LRU storage
The LRUStorage hierarchy implements the decorator pattern and
is capable of providing LRU behaviour to any underlying storage.
There are two concrete classes - LRUStorageST and LRUStorageMT -
that can be used in single thread and multiple thread contentx,
respectively.

Also tests the convention of placing _ as suffix on member
variables.
2016-11-30 10:22:53 +02:00
5d5b2c9d6c Binlog file is checked at max scale startup if encryption is enabled
Binlog file is checked at max scale startup if encryption is enabled.

The check might fail while calculating next pos or verifying event type.
A message is reported
2016-11-30 09:01:42 +01:00
abd73f3700 blr_read_binlog checks replication header after decryption
blr_read_binlog can now check the  replication header after decryption,
for encrypted events.

Added a small fix for slave server requesting position of
START_ENCRYPTION_EVENT: new pos points to first encrypted event.
2016-11-29 17:57:32 +01:00
c7c68410be Merge branch 'develop' into binlog_server_waitdata_encryption 2016-11-29 17:38:04 +01:00
4ff4e69592 Add stopping and starting of listeners to maxadmin
Listeners can now be stopped and started individually.
2016-11-29 15:04:19 +02:00
ecdeb009b3 Fix dbfwfilter regression
The query throttling functionality was broken by the move to the per
thread rule system. One way to fix this is to move the session specific
throttling information into the client session itself. This allows for a
simpler system with no direct dependencies on the rules or users
themselves.
2016-11-29 14:19:08 +02:00