Commit Graph

807 Commits

Author SHA1 Message Date
457fc80647 Merge branch '2.1' into develop 2017-06-05 13:25:27 +03:00
539474a28d Disable RocksDB tests in 2.1
The RocksDB based cache storage is not built by default so the tests
should be disabled.
2017-06-05 13:20:15 +03:00
9124de86df Add default value to MaskingFilter "fill" setting
MXS-1261. If "fill" is not defined, an "X" is used as default.
Setting an empty string as "fill" or "value" is disallowed.
2017-06-05 11:30:06 +03:00
53a2139bb9 MXS-1267: Use filter template in tee
The tee filter now uses the MaxScale filter template.
2017-06-02 13:07:02 +03:00
e64e24a819 MXS-1267: Fix tee filter test results
The tests should no longer expect client session creation to fail if the
branch session creation is not successful.

The main session is kept alive so that a failure in the branch session
does not cause a failure of the main session. The main session can be
considered more important as it is what the client will use. If the branch
session fails, the failure will be logged so no information is lost.

Also added a missing configuration file and removed some extra-verbose
output in a test script.
2017-06-02 13:07:02 +03:00
e32937c8f2 MXS-1267: Rename tee structures
The structures now use C++ style names. This is done before the filter is
moved over to the filter template.
2017-06-02 13:07:02 +03:00
d754ebdf72 MXS-1267: Iterate over available listeners
The tee filter iterates over the available ports and finds the first
available network listener and tries to connect. This allows the use of
UNIX domain sockets with services that are targeted by the tee filter.
2017-06-02 13:07:02 +03:00
7fab3f5d1d MXS-1267: Use local client in tee
The tee filter now uses the local client class to clone the queries. This
imposes some restrictions on how the filter can be used but also makes
MaxScale as a whole more robust.
2017-06-02 13:07:02 +03:00
c67b76b486 MXS-1267: Add local client class
The local client class handles a network connection to a local service. It
is meant to be used with the tee filter so that the internal cloning of
DCBs can be removed.

The local client class connects to a port on the local host. This requires
that the user connecting to the tee filter has adequate grants to connect
locally to a MaxScale service.

After authentication for the local client is complete, the client will
pipe all queries to the service while ignoring any responses it
generates. This could be expanded so that a special handler would be given
as an argument. The handler would then handle the responses to the
queries.
2017-06-02 13:07:02 +03:00
7e70b8c58b MXS-1267: Compile tee filter as C++
Compile the tee filter as C++.
2017-06-02 13:07:02 +03:00
ba546fcd21 MXS-1220: Add execution of module commands to REST API
The module command self links now point to an endpoint that executes the
module command. Depending on the type of the module command, either a GET
or a POST request must be made.
2017-06-02 12:52:33 +03:00
f546a17e77 Update change date of 2.2 2017-06-01 10:24:20 +03:00
607bdf3a1b Remove RocksDB storage tests for cache filter
The RocksDB based storage library is no longer built so the test do not
need to be built either.
2017-05-26 08:52:38 +03:00
322983a5f4 Merge branch '2.1' into develop 2017-05-17 13:48:52 +03:00
39ca791a49 Assign service pointer for cloned tee DCBs
When a cloned DCB is created, the service pointer is not copied and it
needs to be manually set in the newSession entry point. This most likely
due to the fact that the cloned DCB always has a different service and it
is not possible to deduce it.

Another option would be to pass the target service as a parameter but the
whole DCB cloning process could use with a rewrite so any modifications
beyond the required minimum are wasteful.
2017-05-15 19:32:02 +03:00
8e2c7fd952 Merge branch '2.0' into 2.1 2017-05-10 09:12:42 +03:00
fb5ca52565 TPMfilter now prints latencies of individual statements. 2017-05-09 16:33:17 +03:00
370cff3528 Remove dependencies on FLEX/BISON targets
The FLEX and BISON targets don't seem to be actual CMake targets which
cause warnings to be emitted.
2017-05-09 16:22:55 +03:00
0ea58ea6bc Add dependency on FLEX/BISON parts for dbfwfilter
The dbfwfilter didn't depend on the two targets which could cause
compilation problems when running a parallel build.
2017-05-09 15:31:58 +03:00
e8b14dd8b0 Remove debug output 2017-05-08 14:54:23 +03:00
07175ed86b MXS-1220: Add old filter diagnostic interface
Added old diagnostic interface for filters.
2017-05-04 09:14:04 +03:00
076599ee5e MXS-1220: Make the parameters of the diagnostic entry points const
The diagnostic entry points should not modify the state of the object
being diagnosed.
2017-05-04 09:14:03 +03:00
bc3cfe0221 MXS-1220: Fix memory leaks
Some of the JSON objects created in the diagnostic functions leaked
memory.
2017-05-04 09:14:03 +03:00
25c8fb8556 MXS-1220: Implement JSON diagnostics entry point all filters
The second and final part of the filters now implement the JSON version of
the diagnostics function.
2017-05-04 09:12:15 +03:00
12baa304e6 MXS-1220: Implement JSON diagnostics entry point in first part of filters
First part of the filters now implement the JSON version of the
diagnostics function. The rest are converted in a followup commit.
2017-05-04 09:12:15 +03:00
deb11ae6eb Merge branch '2.1' into develop 2017-04-27 09:11:02 +03:00
c8c2822c7b Link storage_rocksdb with lz4 2017-04-26 13:15:23 +03:00
33b809eec1 Do not build storage_rocksdb by default 2017-04-20 13:12:46 +03:00
c3cfc86a7b Merge branch '2.1' into develop 2017-04-19 18:19:13 +03:00
d03b059107 Cache length of buffered data
If a complete response is delivered in many buffers, then calling
gwbuf_length() whenever you need the complete size starts to hurt.
By caching the length of the data received sofar and by updating
the length in clientReply(), gwbuf_length() will be called exactly
once for each buffer(chain) delivered to routeQuery().
2017-04-19 18:15:56 +03:00
f4a5134a83 MXS-1212: use res.length for buffer length instead of computing the size of the whole buffer chain
This reduces CPU usage and decreases the response time for result sets
with many rows.
2017-04-07 12:16:50 +02:00
ad1c05b015 Merge branch '2.1' into develop 2017-04-05 11:35:13 +03:00
e0a98f6539 Fix calls of pcre2_substitute
If the output buffer given to pcre2_substitute is too small, an error
value is written to the last parameter (output length). That value
should not be used for calculations. This patch gives a copy as
parameter instead.

Coincidentally, this commit fixes the crashes of query classifier tests.

Also, increase buffer growth rate in utils.c.
2017-04-04 16:19:21 +03:00
0c3f9ffa2e Maxrows: documentation update and use of MXS_MODULE_PARAM_SIZE for max_resultset_size parameter
max_resultset_size parameter now uses MXS_MODULE_PARAM_SIZE and
config_get_size

Documentation change follows the change.
2017-04-04 08:43:55 +02:00
1fb8cde5d8 NamedServerFilter: Add HINT_ROUTE_TO_ALL support
This was already supported by HintRouter. The tag for the MaxScale
config file is "->all". Also add note to Documentation and reformat
it a bit.
2017-04-04 09:40:04 +03:00
815780aa4a In cache testrules.c ensure there seems to be at least one thread 2017-04-03 14:20:54 +03:00
657d79470c Update NamedServerFilter documentation
The document is now up to date with the rewrite. Also added an assert
to enforce a minimum number of allowed match-target pairs.
2017-04-03 09:49:12 +03:00
e6d2c96f5b MXS-1211: maxrows should be configurable to return error when limit has been exceeded
New parameter added to maxsrows filter:
max_resultset_return=empty|error|ok
Default, 'empty' is to return an empty set, as the current
implementation.
'err' will return an ERR reply with the input SQL statement
'ok' will return an OK packet
2017-03-31 14:26:44 +02:00
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
4b2d94d0f8 When a transaction has been started, no other checks are needed
If we do check then we will end up turning off the read only flag
that just was set on.
2017-03-28 16:17:13 +03:00
f2734f895e Revert "Update dbfwfilter build configuration"
This reverts commit 09ef292283311483354e6cd628318a5cafd96b2c. The old
syntax is still required on SLES 11.
2017-03-27 10:01:54 +03:00
7bd05d4581 Merge branch '2.1' into develop 2017-03-22 15:20:21 +02:00
d0a9571da0 Introduce new qc_parse() prototype
It is now possible to specify what information the caller is interested
in. With this the cost for collecting information during the query parsing
that nobody is interested in can be avoided.
2017-03-22 11:09:36 +02:00
15a22ec295 Do not use shared PCRE2 match data
The match data needs to be unique for each thread, so for the time
being it is created whenever it is needed. A more performant (although
possibly to a negigible amount) solution would be to have a separate
match data for each thread, but that will have to wait for 2.2.
2017-03-21 15:21:13 +02:00
117534d288 Use JIT in regex matching if available 2017-03-21 15:21:13 +02:00
17057ef340 Use thread specific pcre2 match data
For 2.2 a worker/thread object need to be passed around so that
not everyone need to create their own thread id mechanism.
2017-03-21 15:21:13 +02:00
b81c86f228 A rules object may be empty 2017-03-21 10:35:30 +02:00
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
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
0e9abda06f NamedServerFilter allow ->master and ->slave, check parameter types
The filter now checks what types of parameters it has been given and
only accepts the old style (match, server) XOR new style (match01,
target01 etc).

Adds support for special targets ->master and ->slave.
Code cleanup.
2017-03-20 09:51:01 +02:00