46 Commits

Author SHA1 Message Date
MassimilianoPinto
0a468a910b Makefile modifications
Makefile modifications
2014-09-11 13:10:02 +02:00
MassimilianoPinto
8b5b4a17fe Merge from Z3
Merge from Z3
2014-09-11 12:51:16 +02:00
Markus Makela
6196dfb050 fix to bug 475 2014-09-10 16:18:47 +03:00
Mark Riddoch
950c30e065 Fix bug 528 - wrong service name in tee fitler crashes MaxScale 2014-09-09 08:50:15 +01:00
VilhoRaatikka
d77b9f4de3 server/core/test/makefile and
server/modules/filter/Makefile: Added path to libmysqld (-L<path>) so that linker finds it at compile time.
server/test/MaxScale_template.cnf: added write_ses_variables_to_all=Yes and read_ses_variables_from_slaves=Yes so that tests included in testall target succeed (at server/modules/routing/readwritesplit/test). Added hint filter to 'normal' rwsplit service.
2014-09-09 09:36:24 +03:00
VilhoRaatikka
f74493d922 server/modules/filter/Makefile: Fixed problem which prevented cleaning and compiling hintfilter library.
server/core/config.c: Removed unused if..else block from config_get_valint. Changed it also to return value which indicates whether the operation succeed. Added config_get_valbool similar to config_get_valint.
service.c:Added typelib-like struct and array of valid boolean values. Fixed parameter type test in service_set_param_value. Completed boolean type parameter handling.
hintparser.c:Fixed error message for non-maxscale hints.
readwritesplit.c:Added loading of configuration parameters from service to instance and from instance to each new session. Fixed routing condition in get_route_target. Modified get_route_target so that it takes also rw_read_sesvars_from_slaves and rw_write_sesvars_to_all as parameters.
skygw_types.h: added array size counting macro.
2014-09-08 21:44:23 +03:00
Markus Makela
7b7fc74cfa RabbitMQ filter is now built by default and can be disabled with BUILD_RABBITMQ=N 2014-09-05 12:00:48 +03:00
Markus Makela
aafc891c9a Fixed canonical query test and mqfilter.c bugs 2014-09-05 10:58:54 +03:00
Markus Makela
a81bebbc8f Removed the mqfilter sources from the default filter build 2014-09-04 16:16:41 +03:00
Markus Makela
d7b604bfa3 Added BUILD_RABBITMQ makefile variable to define if the mqfilter is built 2014-09-04 16:13:17 +03:00
Markus Makela
9c7781e062 Merging rabbitmq into Z3 2014-09-04 15:01:05 +03:00
VilhoRaatikka
4a30626974 Merge branch 'Z2' of https://github.com/skysql/MaxScale into Z2
Conflicts:
	client/Makefile
	server/core/buffer.c
	server/core/test/makefile
	server/include/buffer.h
	server/modules/filter/Makefile
	server/modules/routing/webserver.c
2014-08-29 16:21:08 +03:00
Mark Riddoch
d6a2ef6996 Misc fixes to doxygen comments 2014-08-19 13:22:40 +01:00
Hartmut Holzgraefe
fb87f68368 consistently use DEL instead of rm in Makefiles 2014-08-17 21:02:24 +00:00
VilhoRaatikka
86a4c3ba90 Fix to #472, http://bugs.skysql.com/show_bug.cgi?id=472
Fix to #473, http://bugs.skysql.com/show_bug.cgi?id=473

Several memory issues. Read the code.
In general one-off hint is only added to gwbuf and freed in gwbuf_free. Stacked hint is copied to stack and to gwbuf. gwbuf is freed after routing but stacked hint is freed either in stop or when session is closed. All this applies to named hint as well except that in addition, it has one more copy in named hint struct which is emptied when session is closed.
2014-08-08 01:28:07 +03:00
VilhoRaatikka
0659d7abd0 Partial fix to Bug #470, http://bugs.skysql.com/show_bug.cgi?id=470.
hintparser.c:token_get_keyword: Handling for TOK_STRING was missing.
2014-08-06 18:09:06 +03:00
VilhoRaatikka
bcc04b840b Merge branch 'Z2' of https://github.com/skysql/MaxScale 2014-08-06 16:48:50 +03:00
VilhoRaatikka
b72e80b464 Fix for Bug #466, http://bugs.skysql.com/show_bug.cgi?id=466
hintparser.c:hint_parser:when string token is found, create a copy of the token value instead of copying the its address because token will be freed before the value is used.
	hint_next_token:didn't recognize '=' as TOK_EQUAL, fixed that. Read the code.
hint.c:hint_create_parameter: copy the pointer to parameter name instead of creating copy of it - pname is already copied from token before the call
readwritesplit.c:routeQuery:Hint name was copied when hint value was supposed to be copied, thus resulting invalid value for hinted parameter. Also fixed server type in trace log command.
skygw_debug.h:Added string for Relay server to macro STRSRVSTATUS.
2014-08-06 16:39:22 +03:00
MassimilianoPinto
d06cad1457 Documentation update
Documentation update
2014-08-06 09:33:55 +02:00
VilhoRaatikka
08b99c121e Bug #468, http://bugs.skysql.com/show_bug.cgi?id=468, Query classifier accessed freed thread context. If parsing fails thd doesn't need to be freed because it holds correct information about command type.
session.c:session_setup_filters : fixed memory leak
hintparser.c: added token_free for HINT_TOKENs and fixed a few memory leaks.
mysql_client_server_protocol.h: added mysql_protocol_done which frees memory blocks pointed to by protocol members. Those can't be freed in dcb.c because dcb.c doesn't know about protocol's members.
mysql_backend.c:gw_backend_close: fixed memory leak
mysql_client.c: gw_client_close: fixed memory leak
mysql_common.c: added implementation of mysql_protocol_done
        :protocol_archive_srv_command: tried to fix memory leak. Some memory is still leaking according to valgrind. Removed use of uninitialized local variable len.
readwritesplit.c: Fix to bug #469, http://bugs.skysql.com/show_bug.cgi?id=469,  rwsplit counts every connection twice in master - counnection counts leak
	execute_sescmd_in_backend: fixed a memory leak - visible only in DEBUG=Y build.
readwritesplit/test/makefile: added target for hints tests
2014-08-05 18:14:06 +03:00
VilhoRaatikka
4f3d746f4e MAX-157. Added support for hints in rwsplit router.
buffer.c: added memory release for hint of a GWBUF
hint.c: added bool hint_exists()
hint.h: added placeholder for hint type HINT_ROUTE_TO_ALL which doesn't have implementation yet.
filter/Makefile: fixed dependency issue
hintparser.c: added const char* token_get_keyword(), hint_parser:added NULL check, hint_next_token: fixed off-by-one bug
readwritesplit.h: added bitfield for hints' use, which includes route targets and flag for case where user hinted to route to named backend server.
readwritesplit.c: added function route_target_t get_route_target() for resolving route target based on 1) query type (from query_classifier) 2) transaction state (active/not) and 3) hints. Modified get_dcb, which is called in routeQuery to provide pointer to correct backend DCB. Now get_dcb also takes server unique name as a parameter if such a hint was found. for hints' use, which includes  enter the commit message for your changes.
2014-07-31 23:40:02 +03:00
Mark Riddoch
2dea68b9b3 Hint parsing 2014-07-25 16:33:49 +01:00
Mark Riddoch
4af2e58c86 Update plugin status to BETA 2014-07-04 09:23:40 +01:00
Mark Riddoch
d58682d261 Updated Makefile to resolve issue with adding extra MaxScale in the
path for a make install command.
2014-07-01 16:53:10 +01:00
Mark Riddoch
f96b762478 User interface improvements
Addition of enable/disable heartbeat, enable/disable root, list monitors,
show monitors

Better filter diagnostic output
2014-06-26 16:46:19 +01:00
Mark Riddoch
a652e875b5 Support for multipacket statements
Remove double free in cloned DCB's
2014-06-24 17:59:29 +01:00
Mark Riddoch
e650930487 Cleanup up branch session on close. 2014-06-23 10:10:04 +01:00
Mark Riddoch
7067e43b44 Core changes to support tee filter. 2014-06-20 17:49:40 +01:00
Mark Riddoch
e98b5d411e Addition of tee filter 2014-06-20 11:47:07 +01:00
Mark Riddoch
c759767a91 Use new session entry points to get remote and user rather than dereference
the DCB directly.
2014-06-19 16:07:21 +01:00
Mark Riddoch
058d553973 Addition of user and source to all filter
Bug fix in timestamp for topfilter
2014-06-19 14:02:41 +01:00
Mark Riddoch
4d257897d3 Merge branch 'develop' of github.com:skysql/MaxScale into develop
Conflicts:
	server/core/session.c
	server/modules/protocol/mysql_backend.c
	server/modules/routing/readwritesplit/readwritesplit.c

Resolved.

Addition of user in topfilter report and general tidyup
2014-06-18 17:45:57 +01:00
Mark Riddoch
70ba1f028a Fixed bug in generation of execution time in report 2014-06-15 23:03:41 +01:00
Mark Riddoch
480c842308 Improved diagnostics in filters 2014-06-13 08:50:28 +01:00
Mark Riddoch
1868210a59 Enhancements to topfilter and qlafilter
Documentation for topfilter and qlafilter
2014-06-13 08:35:23 +01:00
Mark Riddoch
d17315b2cd Updated QLA filter to allow for regex matches and client address matches
to control the statements that are logged.
2014-06-11 23:55:29 +01:00
Mark Riddoch
a8def0d670 Additional error checking and documentation.
Implementation of topfilter options
2014-06-10 11:57:48 +01:00
Mark Riddoch
77e1426dbf Initial upstream fitlering implementation.
Test filter with up and down stream filtering. Keeps top N queries
and prints a report of these queries on session close.
2014-06-09 21:13:28 +01:00
Mark Riddoch
656c54af0a Fixed memory allocation issue when the repalcement text is considerably
longer than the match text.
2014-06-05 17:08:44 +01:00
Mark Riddoch
be87556ab0 Fix for compiler warnings 2014-06-05 15:26:57 +01:00
Mark Riddoch
ea177b481f Fixed for typo in modutil.h
Addition of timestamps to the query log produced by the QLA filter
2014-06-04 23:30:54 +01:00
Mark Riddoch
46ca0676c0 A filter parameter fix and a new filter, the regex filter.
The regexfilter is an example of a query rewriting filter that uses
regular expressions to match the SQL text and allows a replacement text
to be used for each match of the regular expression.

Regexfilter has no special SQL undertanding, it merely uses the features
avialable inthe regex library to perform matches.

Statements that span multiple packets are not supported by the regex
filter.
2014-06-04 23:04:17 +01:00
Mark Riddoch
57e910ad3d Addition of the module utilities functions 2014-06-04 18:34:24 +01:00
Mark Riddoch
1d48794963 Addition of API modinfo implementation for filters 2014-06-02 18:18:31 +01:00
Mark Riddoch
857ae25570 Addition of session filter tracking in order to allow the show session
command to call the diagnostic entries points of the filters in the
session.

Slight improvements to the two example filters and a fix to the
trim routine.
2014-06-02 10:56:50 +01:00
Mark Riddoch
8d55be4b23 First working filters implementaton.
Only downstream filters are supported currently, i.e. no result
set filtering can be done.

A crude QLA (Query Log All) filter is included as a test harness only
2014-05-30 16:45:39 +01:00