Commit Graph

4658 Commits

Author SHA1 Message Date
c067bbe34a Formatted the canonical query test.
The file is now formatted according to the style guide.
2016-01-11 17:13:01 +02:00
9c9e30fa08 Fixed value replacement and added more tests for canonicalization of queries
The value replacement was not taking session or system variables into notice.
2016-01-11 17:09:40 +02:00
995ed8c9d2 Improved query canonicalization
The query does not need to be parsed for it to be canonicalized and the parsing
uses the PCRE2 library. The regular expressions were changed so that only one
call to the function which replaces literal unquoted values is made.
2016-01-11 17:08:03 +02:00
b01e8b2eec Added utils library initialization function and improved replace_quoted
Currently the initialization function only prepares PCRE2 patterns for use.
Added the call to the new utils_init() function to MaxScale and all relevant
tests.

The replace_quoted now uses a shared PCRE2 pattern which should remove some
of the overhead of the function.
2016-01-11 17:04:39 +02:00
f57df4b967 Hide unused public functions
parse_query and query_is_parsed are not used outside query classifier
anymore. Consequently, they can be made internal.
2016-01-11 15:28:00 +02:00
4d155f70b0 Remove call to parse_query.
Not needed anymore.
2016-01-11 15:14:27 +02:00
20bc6a4ab7 Reindent canonizer.c
- Untabify
- Remove trailing whitespace.
- Allman braces.
2016-01-11 15:08:27 +02:00
79fa226000 Move private type to implementation.
parsing_info_t is only used by the query_classifier implementation.
No need to keep it public.
2016-01-11 14:58:15 +02:00
23a7562d3a Replace skygw_ type prefix with qc_.
- skygw_query_type_t renamed to qc_query_type_t.
- skygw_query_op_t renamed to qc_query_op_t.
2016-01-11 12:06:21 +02:00
2f42246880 Rename query classifier functions consistently.
All public query classifier functions now have the prefix qc_.
2016-01-11 12:04:52 +02:00
ec281849aa Remove explicit calls to parse_query.
Now that all query classifier functions parse the query if it
has not been parsed, there is no reason for any module to call
parse_query explicitly.
2016-01-11 10:15:13 +02:00
6e6ad67504 Parse query if it has not been parsed already.
Now consistently all functions parse the query if it has not
been parsed already.
2016-01-11 10:02:27 +02:00
23ebd581dc Fix mistake in optimise-core branch, dcb.c. 2016-01-08 14:11:50 +00:00
bd02835139 Fiddle around with spaces. 2016-01-08 13:47:34 +00:00
fb5fdb17db Switch bitmask_clear to be locking and offer bitmask_clear_without_spinlock for non-locking version, in response to review comments. Revert poll.c to use bitmask_clear (with locking) and amend dcb.c to use the non-locking version and to take advantage of the return of an indication of whether the whole bitmask is then clearn. 2016-01-08 13:47:34 +00:00
4461cd9398 Streamline modutil_get_complete_packets code. No external impact. 2016-01-08 13:47:34 +00:00
aa79e61aac Various optimisations of bitmask processing. External change is that bitmask_clear() does not apply a spinlock, so must be called with exclusive access to the bitmask. This affects the call in shutdown processing in poll management. The call from DCB processing is safe because zombie processing has exclusive access to DCBs. 2016-01-08 13:47:34 +00:00
78b363aec7 Enhance buffer handling by changing gwbuf_free to free the whole list of buffers (although it could contain only one buffer). Add gwbuf_count to give number of buffers in a buffer list (for convenience in debugging). Add gwbuf_alloc_and_load to simplify putting data into a new buffer. 2016-01-08 13:47:34 +00:00
57b79fc663 Remove unecessary calls to query_is_parsed/parse_query.
query_classifier_get_operation() parsed the query if it has not
yet been parsed. In the other places, the query need not be
parsed.
2016-01-08 11:52:20 +02:00
97282fca97 Make lines of mqfilter.c less that 110 characters long.
Untabified as well.
2016-01-08 11:43:05 +02:00
cba190f84c Checks for temporary tables are only done if they have been created
Previously all queries were inspected for CREATE, DROP and SELECT statements
which targeted temporary tables even if they haven't been created.
2016-01-08 11:16:43 +02:00
b84e739cfa All queries related to prepared statement are sent to the master
The preparation and closing of prepared statements was sent to all servers
even though the execution was always sent to the master. With this change,
all queries which interact with prepared statements are only sent to the master.

The sending of statement preparations to all servers is a problem when a
statement which depends on a database or a table is created and the DDL
statement which created that table has not yet been replicated to the
slaves.

In addition to fixing the aforementioned problem, this change should also
reduce unnecessary network traffic to slaves and improve the overall
performance of the prepared statements.
2016-01-08 11:16:30 +02:00
40cfe1a864 Merge branch 'release-1.3.0' into develop 2016-01-08 11:14:02 +02:00
36bd218afd Cleaned up documentation
Fixed spelling mistakes, cleaned up formatting and added missing links.
2016-01-08 11:02:12 +02:00
2b83530ae9 Make dbfwfilter.c rows less than 110 character long. 2016-01-08 10:35:53 +02:00
4b21154066 Make private query_classifier functions static.
parsing_info_init and parsing_info_done are only used by
query_classifier. Hence they should not be public and extern.
2016-01-07 22:36:15 +02:00
d99cece151 Removed the 16 chars limitation for binlog file name
Removed the 16 chars limitation for binlog file name
2016-01-07 15:29:11 +01:00
5b91f98067 Removed the 16 chars limitation for binlog file name
Removed the 16 chars limitation for binlog file name
2016-01-07 14:36:52 +01:00
e0e0d3a5e5 Add location of source and packages to readme. 2016-01-05 16:09:10 +02:00
bd95ea2d35 MXS-451: Made documentation clearer about slave_selection_criteria
The documentation for readwritesplit now clearly states that only connections
from MaxScale are taken into consideration when slaves are being selected.
2016-01-04 18:40:01 +02:00
145abf5a53 MXS-452: Updated readwritesplit documentation
The documentation now mentions that weightby works with readwritesplit and
links to the configuration guide for more information.
2016-01-04 18:40:01 +02:00
4ef89d213b MXS-463: Filepaths are now properly formatted for printing
The various global directory setter functions now process the input they receive
and remove redundant and trailing forward slashes from the directory paths.
2016-01-04 18:40:00 +02:00
05a7f5759b Fixed thread safety issues in schemarouter and shardrouter
Fixed strtok being used in a multithreaded context and removed unused code.
2016-01-04 18:40:00 +02:00
3abcb52837 MXS-502: Server state changes are logged at notify level
When MaxScale perceives a state change in one of the servers it will log
an message into the log file stating the previous and the current state.
This will make it easier to analyze failures in the cluster.
2015-12-30 19:49:41 +02:00
901dfd23c0 Changed burst_size to long instead of unsigned long
Changed burst_size to long instead of unsigned long.
This way check burst_size > 0 is now effective.

Setting "burstsize" option in router_options may be required.
i.e.: burstsize=10M
2015-12-30 16:14:51 +01:00
9ba2e4b97e Changed burst_size to long instead of unsigned long
Changed burst_size to long instead of unsigned long.
This way check burst_size > 0 is now effective.

Setting "burstsize" option in router_options may be required.
i.e.: burstsize=10M
2015-12-30 16:14:13 +01:00
309f794992 Added images to RabbitMQ and Tee tutorial
Added an image which depicts the use-case for the tutorial.
2015-12-30 16:53:57 +02:00
94edc847c2 Updated readconnroute limitations
The limitation with readconnroute and LONGBLOB is only when data is being sent
from the client to MaxScale. The client can still query for LONGBLOB data
without any side-effects.
2015-12-30 14:50:03 +02:00
cec2c3670d Added a link to the persistent connection tutorial to the configuration guide
Also bolded out the note about session state tracking.
2015-12-30 11:35:30 +02:00
e40944c9b9 Added note about persistent connections
Since the persistent connections do not track session state, a note should
be added somewhere which states this.
2015-12-30 11:31:36 +02:00
3c69e641b9 Fixed false backend authentication failures
It was possible that a backend server was doing authentication while the client
closed the session. The more connections the router created the more likely it
was. This caused unnecessary reloading of the database users and confusing error
messages.

With the implemented fix, there are additional checks for the session state
before the users are reloaded or error messages are logged.
2015-12-30 05:13:27 +02:00
080a9ebc9d PCRE2 is now statically linked
Since the PCRE2 library was always going to be a part of MaxScale, there was
no real reason to have it as a shared library apart from smaller binaries.
2015-12-29 10:09:38 +02:00
e305a88e0e Enabled CPACK_DEBIAN_PACKAGE_SHLIBDEPS again
The removal of this from the DEB packages caused no dependencies to be generated.
2015-12-29 10:09:38 +02:00
0cf564aa0d Fix to MXS-508: Fixed username matching in regexfilter
The username matching was working as intended but the session's active value
was ignored when queries were being routed. This meant that both the username
and the IP address of the user were ignored and query replacement was always
done.
2015-12-29 09:57:27 +02:00
e9755ba2b6 Remove file from slave
The binlog file is now always opened when it is needed and closed
when we are finished with it. That will remove any potential
file concurrency issues between different threads dealing with
the same slave.
2015-12-29 09:47:37 +02:00
04f807290a Remove file from slave
The binlog file is now always opened when it is needed and closed
when we are finished with it. That will remove any potential
file concurrency issues between different threads dealing with
the same slave.
2015-12-29 09:42:09 +02:00
05fb07f996 Removed extra brace
Removed extra brace
2015-12-28 18:00:55 +01:00
4f8340f5b2 Changed behaviour for a slave requesting master_log_pos beyond binlog file size
Slave request for a log_pos behind binlog file size may result in a
disconnection or replication error:

if binlog file is latest one slave get disconnected otherwise an error
message is returned and replication stops
2015-12-28 18:00:52 +01:00
71212a824b Removed extra brace
Removed extra brace
2015-12-28 17:56:39 +01:00
0f51f9c714 Changed behaviour for a slave requesting master_log_pos beyond binlog file size
Slave request for a log_pos behind binlog file size may result in a
disconnection or replication error:

if binlog file is latest one slave get disconnected otherwise an error
message is returned and replication stops
2015-12-28 17:56:33 +01:00