387 Commits

Author SHA1 Message Date
Markus Makela
41226692ac Merge branch 'release-1.0beta-refresh' into cmake_build 2014-09-16 12:11:17 +03:00
Mark Riddoch
fb4f74ed61 Changed SPINLOCK_PROFILE back to #if so that defining SPINLOC_PROFILE 0 turns
off the profilign of spinlocks
2014-09-15 09:38:58 +01:00
VilhoRaatikka
bc320d1514 Cannot compile 2014-09-15 11:09:12 +03:00
Mark Riddoch
066b58afb0 Turn off spinlock profiling 2014-09-15 08:05:47 +01:00
Markus Makela
4c41dea6fb Merge branch 'release-1.0beta-refresh' into cmake_build 2014-09-15 09:43:24 +03:00
MassimilianoPinto
8818f23176 Added localhost_match_wildcard_host parameter
Added localhost_match_wildcard_host parameter to service
2014-09-12 16:24:55 +02:00
MassimilianoPinto
3bb614d9eb brand release-1.0beta-refresh merged
brand release-1.0beta-refresh merged
2014-09-12 16:00:36 +02:00
Mark Riddoch
d1b4852d29 Addition of server "Auth Error" status 2014-09-12 08:55:32 +01:00
Markus Makela
00449dfd48 added the missing version.h template file 2014-09-11 20:19:10 +03:00
MassimilianoPinto
8b5b4a17fe Merge from Z3
Merge from Z3
2014-09-11 12:51:16 +02:00
MassimilianoPinto
7245d1baa1 blr branch merge
blr branch merge
2014-09-11 12:20:42 +02:00
MassimilianoPinto
f15815c6bb New service parameter localhost_match_any
New service parameter ‘localhost_match_any’ allows localhost matching
the wildcard host.

Default value is 0, don’t match.
It may be changed if backend servers don’t have the anonymous user
‘’@localhost
2014-09-10 17:12:25 +02:00
VilhoRaatikka
025f920ddb Replaced RWSplit parameters write_ses_variables_to_all and read_ses_variables_from_slaves with
use_sql_variables_in=[master|all] (default all)
Modified MaxScale Configuration And Usage Scenarios-Z3.pdf and MaxScale_template.cnf accordingly.
Fixed typo in server/modules/routing/readwritesplit/test/rwsplit.sh
2014-09-10 11:32:53 +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
VilhoRaatikka
92889ad216 config.c: Added configuration parameter processing for read_ses_variables_from_slaves and for write_ses_variables_to_all . The values are read from config file, qualified and stored to service. Values are loaded when instance is created. This is limitation in current implementation and will change so that configuration is dynamically changeable. 2014-09-07 23:48:16 +03:00
Mark Riddoch
c273988e51 Fixed for EPOLLHUP events
Possible double free in maxscaled on close

binlog router debugging/tracing
2014-09-05 17:29:17 +01:00
VilhoRaatikka
0630b2ff46 Merge branch 'Z3' of https://github.com/skysql/MaxScale into Z3
poll.c:poll_add_dcb: Addded EPOLLHUP back to flag set.
2014-09-04 12:29:06 +03:00
MassimilianoPinto
63a7ccf520 Merge branch 'MAX-232' into 232-bis
Conflicts:
	server/core/server.c
	server/include/server.h
2014-09-04 09:23:29 +02:00
MassimilianoPinto
63d267e5ef Fix for broken replication
Fix for broken replication has been added to mysql_monitor.
Both Slave_IO  and Slave_SQL threads must be running in order to assign
the SERVER_SLAVE status but If only Slave_IO is running let’s assign
the master_id to current server and continue building the replication
tree; if no slaves at all the master will be still available.
The “detect_stale_master” option has been added, its default is 0.
If set to 1 the monitor will keep the last detected master even if the
replication setup is completely not working, i.e. both Slave_IO  and
Slave_SQL threads are not running: this applies only to the server that
was master before.
After monitor or MaxScale are restarted and the replication is still
stopped or not configured there will be no master because it’s not
possible to compute the replication topology tree.
2014-09-01 11:18:57 +02:00
Markus Makela
a17e584adb Merge remote-tracking branch 'origin/Z3' into MAX-237
Conflicts:
	query_classifier/query_classifier.cc
	query_classifier/query_classifier.h
	server/modules/routing/readwritesplit/readwritesplit.c
2014-09-01 11:05:10 +03:00
Mark Riddoch
877442c941 Addition of periodic task execution via the housekeeper thread
Addition of 15, 5 and 1 minute load averages in poll
2014-08-29 16:53:05 +01:00
VilhoRaatikka
40416d424e Merge branch 'Z3' of https://github.com/skysql/MaxScale into Z3
Conflicts:
	gcov.diff
	server/core/buffer.c
	server/include/buffer.h
	server/modules/routing/readwritesplit/readwritesplit.c
2014-08-29 18:50:32 +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
VilhoRaatikka
9ce36d7242 Merge branch 'master' of https://github.com/skysql/MaxScale 2014-08-29 14:46:06 +03:00
Mark Riddoch
531dfd017c Addition of thread data to commands 2014-08-29 11:24:58 +01:00
Markus Makela
7ea53f0141 Merge remote-tracking branch 'origin/MAX-160' into MAX-237
Conflicts:
	query_classifier/query_classifier.cc
	query_classifier/query_classifier.h
2014-08-29 11:02:03 +03:00
VilhoRaatikka
531d8d7b47 query_classifier.cc: added detection for CREATE TEMPORARY TABLE and setting a new query type QUERY_TYPE_CREATE_TMP_TABLE for it.
query_classifier.h: added QUERY_TYPE_CREATE_TMP_TABLE and QUERY_TYPE_READ_TMP_TABLE for use of temporary table support.
hashtable.c:Added variant of hashtable which is 'flat', that is, stored to existing memory instead of allocating memory as a part of the call. Existing function declarations don't change but added hashtable_alloc_flat for the purpose. Both hashtable_alloc and hashtable_alloc_flat now call the real allocation function, hashtable_alloc_real. hashtable_free only frees memory which is allocated in hashtable_alloc_real.
hashtable.h: added a flag to HASHTABLE struct to indicate whether hashtable owns its memory or not.
readwritesplit.h: Added RSES_PROP_TYPE_TMPTABLES property type to be used for keeping the hashtable for tablenames.
readwritesplit.c: Added comments about temporary table support implementation.
2014-08-29 10:08:48 +03:00
Mark Riddoch
81e1dd8719 Merge branch 'develop' into blr
Add instrumentation

Remove mutexes

Improve gwbuf_append performance

Conflicts:
	server/core/dcb.c
	server/modules/protocol/mysql_backend.c
2014-08-28 11:41:26 +01:00
VilhoRaatikka
ee52ac64a9 query_classifier.cc:skygw_get_canonical: if the item to be replaced is an empty string "", it is processed differently from the other cases due to difficulties to get wanted result by adding special rule for that to regex.
query_classifier.h: added parsing information structure to query classifier away from buffer.h.
buffer.c:introduced a buffer object which includes object pointer and a clean-up call-back function. Buffer objects form a list which is cleaned up by the last referrer of the buffer, as a part of gwbuf_free. Buffer object list is protected by a spinlock gwbuf_lock.
	Also added identifier type, bufobj_id_t which is enumerated type and currently includes one value only, GWBUF_PARSING_INFO. Added also a bitfield for information about the buffer. It currently has one type only, GWBUF_INFO_PARSED indicating that buffer content is parsed and there is buffer object of type GWBUF_PARSING_INFO.
skygw_utils.cc:replace_literal:changed regexec matching to case insensitive because user-defined literals are sometimes converted to upper-case ones.
2014-08-22 19:01:56 +03:00
VilhoRaatikka
c501d4d4e1 Changes related to canonical query format implementation.
query_classifier.cc: Now query can be parsed outside query_classifier_get_type by calling function parse_query. It creates parsing_info_t struct which is then added to the GWBUF which also includes the query. Parsing information follows the buffered query and it is freed at the same time with query buffer, in gwbuf_free.
buffer.c: additions of parsing information to gwbuf struct.
modutil.c: added function which returns query from GWBUF in plain text string.
readwritesplit.c:routeQuery now only calls query_classifier_get_type to get the query type instead of extracting plain text query from the GWBUF buffer.
2014-08-20 22:10:36 +03:00
Mark Riddoch
65b25a825a Addition of adminusers unit test
Fix to filters unit test
2014-08-20 14:50:44 +01:00
Mark Riddoch
baa655182c Merge branch 'master' into develop 2014-08-20 11:07:55 +01:00
Mark Riddoch
d6a2ef6996 Misc fixes to doxygen comments 2014-08-19 13:22:40 +01:00
VilhoRaatikka
677a44f497 Merge from release-1.0beta to Z2 2014-08-15 18:00:39 +03:00
VilhoRaatikka
d3a79ce7c4 Partial fix to #463, http://bugs.skysql.com/show_bug.cgi?id=463
log_manager.cc: fixed block buffer overflow. Queries are logged to trace log and long queries exceed the bufsize in length. Those were written beyond allocated memory areas.
mysql_client_server_protocol.h: added mysql_protocol_state_t to indicate whether MySQL protocol object is allocated, usable or freed. Freed means that memory allocations made by the protocol are freed. That is, command history etc.
mysql_backend.c: gw_backend_hangup and gw_error_backend_event used to call error handling function although session was already closing. Added check for session state.
mysql_client.c: route_by_statement lost some packets in case where query was sent in multiple packets.
mysql_common.c: gw_MySQL_get_next_packet failed in packet handling with route_by_statement. When multi-packet query was merged into one, packet type wasn't copied.
	protocol_archive_srv_command and mysql_protocol_done didn't have proper locking in place which lead to occasional crashes.
2014-08-14 13:05:05 +03:00
VilhoRaatikka
cf38dad43a Merge branch 'Z2' of https://github.com/skysql/MaxScale into Z2
Conflicts:
	server/core/modutil.c
2014-08-05 18:26:55 +03:00
VilhoRaatikka
65b121889b config.h: Added enumerated types MAX_RLAG_AVAILABLE and MAX_RLAG_UNDEFINED to be used instead of magic numbers as max_slave_replication_lag values.
readwritesplit.h: Added TARGET_RLAG_MAX to the list of hint targets. It is used in case of hint max_slave_replication_lag=<value>
readwritesplit.c: get_dcb is called when readwritesplit router chooses target backend for a query. Backend is selected from those the router has connection to. get_dcb now takes additional parameters, name and max_rlag. Name is used if there is a hint route to server <server name>. max_rlag is used for hint max_slave_replication_lag=<value> or if it doesn't exist, then for configure parameter max_slave_replication_lag=<configured value> or if both are absent, ignored.
2014-08-01 16:33:29 +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
MassimilianoPinto
744892e47c Support for MySQL Cluster
Support for MySQL Cluster with ndbcluster monitor and readconnroute
with router_option=ndb
2014-07-30 09:41:03 +02:00
MassimilianoPinto
40546fc689 Added NDB status
Added NDB status
2014-07-30 09:31:37 +02:00
MassimilianoPinto
3f4e67ccca Changed value for SERVER_SLAVE_OF_EXTERNAL_MASTER
Changed SERVER_SLAVE_OF_EXTERNAL_MASTER value to 0x0080 (128)
2014-07-29 16:46:39 +02:00
Mark Riddoch
2dea68b9b3 Hint parsing 2014-07-25 16:33:49 +01:00
Mark Riddoch
764ceac105 Merge branch 'httpd' into MAX-157
Conflicts:
	server/core/buffer.c
	server/include/buffer.h
2014-07-16 18:31:12 +01:00
Mark Riddoch
944ee9134c Initial HINT structure added 2014-07-16 18:29:20 +01:00
Mark Riddoch
87e66a0ea8 Revert "Implementation of HTTPD protocol, gwbuf properties and a dmeo web application"
This reverts commit 6fd5dff34902051f38932947493280e1e62dbeb1.
2014-07-15 17:53:39 +01:00
Mark Riddoch
6fd5dff349 Implementation of HTTPD protocol, gwbuf properties and a dmeo web application
interface to test the new httpd.
2014-07-15 17:39:31 +01:00
VilhoRaatikka
39679447c9 Bugzilla #455, MaxScale crashed due missing buffer type information in multi-buffer responses. 2014-07-03 19:20:45 +03:00
VilhoRaatikka
57a977bdc0 Merge branch 'develop' of https://github.com/skysql/MaxScale into develop 2014-06-30 22:38:15 +03:00
VilhoRaatikka
b875936a21 MAX-94, Added configuration parameter, max_slave_replication_lag=<longest allowed replication lag in seconds> to router section.
Parameter can be changed runtime but it requires reloading of config.
2014-06-30 22:35:27 +03:00
VilhoRaatikka
0b89245a4b Merge branch 'develop' into MAX-167
Conflicts:
	server/modules/monitor/mysql_mon.c
	server/modules/routing/readwritesplit/readwritesplit.c
2014-06-30 14:17:00 +03:00