Commit Graph

724 Commits

Author SHA1 Message Date
272896b50e Fix luafilter build failure
The filter used the old getCapabilities signature.
2017-02-16 10:16:10 +02:00
49cc2b52e3 Merge branch '2.1.0' into 2.1 2017-02-15 08:44:55 +02:00
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
3a3b31ebb4 NullFilter capabilities are now instance specific
There can now in one configuration be multiple Null filters,
each with its own set of capabilities.
2017-02-14 13:55:50 +02:00
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
b46bc47c87 Add NullFilter filter module
NullFilter is a filter module that does nothing, except reports
capabilities as defined in the configuration file. It's purpose
is only to make it simple to benchmark the performance impact
various routing capabilities have.

Note that since getCapabilities() currently does *not* take an
instance pointer as parameter, all NullFilter instances will
report the same capabilities, the ones specified for the last
filter to have been loaded.
2017-02-09 15:02:34 +02:00
ce5cd69eb3 Remove unused locks and variables
Removed unused spinlocks from DCBs, sessions and the MySQL protocol
structs. They were used in a context where only one thread has access to
the structure.

Removed unused member variables from DCBs.
2017-02-08 15:31:17 +02:00
9f88ee3eec Errors must not be cached
For instance, if bob is returned an error because he does not have
the required grants, then if the error were cached, alice would
receive bob's error reply even if she has the required grants.
2017-02-06 09:41:37 +02:00
4ccfc35b00 Fix regression of MXS-1111
The function that was added to detect the commands that should always be
allowed wasn't used.
2017-02-02 13:50:44 +02:00
13997fc5b9 Fix prepared statements being rejected by dbfwfilter
The merge with 2.0 caused the dbfwfilter to reject all prepared statements
when they are supported in 2.1.
2017-02-02 13:34:57 +02:00
a2ffb0476f Fix insertstream value implicit insert detection
The pointer being at the end of the buffer was not checked.
2017-02-02 12:58:30 +02:00
3a447607a7 Move inserstream into the core
The filter is a part of 2.1 so it should be in the core.

Added a note into the documentation about the experimental status.
2017-02-01 21:08:25 +02:00
4ef4cb490b Cache: Use consistent naming
- snake_case
- member variables prefixed with m_
- static member variables prefixed with s_
- where prefixes are used (z,p,s), the following character
  is capitalized
2017-02-01 10:43:41 +02:00
f2da434b56 Fix merge problem with dbfwfilter
Code was duplicated in the merge and the old function names were used.
2017-02-01 09:58:38 +02:00
e64a641bcd Merge branch '2.0' into develop 2017-02-01 09:35:13 +02:00
00f16e1fa5 Make parameters for command_is_mandatory const
The parameters can be const as they aren't modified.
2017-01-31 10:16:33 +02:00
fdee329198 MXS-1111: Allow COM_PING and other commands to pass the firewall
The firewall filter should allow COM_PING and other similar commands to
pass through as they are mainly used to check the status of the backend
server or to display statistics. The COM_PROCESS_KILL is the exception as
it affects the state of the backend server. This is better controlled with
permissions in the server than in the firewall filter.

Commands that require special grants aren't allowed to pass as they are
mainly for maintenance purposes and these should not be done through the
firewall.
2017-01-30 19:16:33 +02:00
03067b586c Cache: Install storage implementations as well
As the cache is marked as being core, the storage modules needs
to be marked as core as well.
2017-01-30 14:23:54 +02:00
4adc9d705b Build Jansson if library not found
If the Jansson JSON library is not found on the system, it is built from
source.
2017-01-27 12:19:27 +02:00
8b83bf834e Clean up router.h
Nothing moved to core, just rename and cleanup.
2017-01-26 16:14:17 +02:00
aa8851fbe1 Remove listmanager
The file wasn't used, so any traces of listmanager.h or .c have been
erased.
2017-01-25 16:11:12 +02:00
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
126d9be749 Remove noisy logging 2017-01-23 15:31:01 +02:00
47d21bd519 Masking: Change "rules_file" parameter to "rules"
The firewall filter and the cache have similar rules files and
they use "rules". To be consistent, the masking filter should
use "rules" as well.
2017-01-23 15:17:23 +02:00
ead0d4fe3e No point storing version info in transient storage
As the RocksDB storage is re-created at each startup it does not
make sense to store version information in it.
2017-01-23 15:09:13 +02:00
6a90b0c629 Ok to continue even if storage directory is created at startup
Due to some refactoring that possibility had been lost.
2017-01-23 15:08:57 +02:00
eb05132a5c Cache: Use MXS_MODULE_PARAM_SIZE 2017-01-23 11:01:57 +02:00
50f594fa4e Fix ccrfilter parameters
The filter used the value of `count` for the `time` parameter.

The `options` parameter used the old-style parsing of the options and the
`match` and `exclude` parameters didn't use config_copy_string.
2017-01-22 09:24:00 +02:00
03402a86ed Check that ccrfilter time is enabled before using it
The filter calculated a time difference which was negative if the filter
was not configured to use time intervals.

Added more info level logging to help determine how the filter behaves.
2017-01-22 09:24:00 +02:00
4e6fde8a23 Use query type instead of operation for ccrfilter
The query operation not being a select is too strict and not very
precise. Only queries that actually modify data should trigger the adding
of routing hints.
2017-01-22 09:24:00 +02:00
7824c98dcc Maxrows filter is now the core 2017-01-20 15:46:03 +01:00
b4d7739bdc namedserverfilter.c: removed unused var
Removed unused var in namedserverfilter.c
2017-01-20 14:40:29 +01:00
872bbd1ab3 Make cache part of the core 2017-01-20 13:30:00 +02:00
be1bdfaa92 Mark masking as part of the core 2017-01-20 13:30:00 +02:00
57b530a2e8 MXS-1065: add wildcards support to source option in namedfilter
It’s possible to add % wildcards in the ‘source’ option of
namedserverfilter.
Allowed values, for an IP address only are:

X.%.%.%
X.Y.%.%
X.Y.Z.%

The match any ‘%’ is not allowed
2017-01-20 12:15:20 +01:00
6e38276a20 Rename files, removing "gw"-prefix
Also gwdirs.h.in -> paths.h.in
2017-01-20 12:55:52 +02:00
ffc68a688f Fix mqfilter build failure
It called an internal session function for no real reason.
2017-01-20 09:09:56 +02:00
c9a61fec6d Masking: Use common constants
- Response related constants moved from ComPacket to ComResponse
- Constants defined using defines from .../maxscale/protocol/mysql.h
2017-01-19 14:52:13 +02:00
6499994af8 Cache: Use existing defines 2017-01-19 14:52:13 +02:00
1077b313a4 Cache: Handle large packets
Basically the only thing that needs to be done is not to mistake
a 8 byte length encoded integer as an EOF packet.
2017-01-19 14:52:13 +02:00
8aa76727d2 Remove explicit long indicator of size defines 2017-01-19 10:42:05 +02:00
31c8481f6c Fix cache parameter default value 2017-01-19 09:26:37 +02:00
8c236c1cdc Define ComEOF packet length in terms of MYSQL_EOF_PACKET_LEN 2017-01-19 09:26:37 +02:00
fed61fde98 Disable prepared statement execution in dbfwfilter
The dbfwfilter doesn't parse prepared statements for all rules which
requires that they are disabled.
2017-01-19 08:57:15 +02:00
cfcd1dc38f Maxrows filter uses new constants: MYSQL_EOF_PACKET_LEN and MYSQL_OK_PACKET_MIN_LEN
New constants MYSQL_EOF_PACKET_LEN, MYSQL_OK_PACKET_MIN_LEN are now
used by max rows filter
2017-01-18 15:47:04 +01:00
e4d6af37a9 Masking: Distinguish between EOF and 8 byte integer
When processing the response to a COM_QUERY, the rows will be
terminated by an EOF packet. However, as the type byte of an
EOF packet is 0xFE and the identifying byte of an 8 byte length
encoded integer is also 0xFE it is not possible to distinguish
the two except by also looking at packet length.
2017-01-18 14:31:48 +02:00
fbb63f4eb8 Masking: Handle larger than 16MB payloads
Larger than 16MB payloads can either be ignored or then they may
cause the session to be aborted.
2017-01-18 08:45:51 +02:00
969e423eb2 Masking: Add large_payload parameter
The masking filter will assume payloads less than 2^24 - 1. The
behaviour if payloads larger than than are encountered can be
configured.

The actual implementation follows in a subsequent change.
2017-01-18 08:44:04 +02:00
16a76fcd28 Rename qc_get_type() to qc_get_type_mask()
To make it plain that it is a mask that is returned and not a
specific value from the enum qc_query_type_t.
2017-01-18 08:34:53 +02:00
86c97a2109 Analyze binary prepared statements as well
Now that the query classifier can be given COM_STMT_PREPARE packets
in addition to COM_QUERY packets, binary prepared statements will
be subject to the same analyses as any other statement.
2017-01-18 08:34:53 +02:00