4320 Commits

Author SHA1 Message Date
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
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
Markus Makela
dfe2806e37 server/core/makefile: added -lmysqld to LDFLAGS so that the tests compile
query_classifier/test/canonical_tests/Makefile: Added hint.o to link flags
2014-09-04 15:44:00 +03: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
f20a224801 MySQL monitor detects broken replication and a new option 'detect_stale_master' has been added.
- Monitor automatically builds the replication topology tree if at least Slave_IO thread is running in slaves and the master server will be available.

- If the replication is stopped or configuration removed the previos master server may be still available with detect_stale_master=1
	The SERVER_STALE_STATUS bit is added to the server->status field

Monitor diagnostic routine print all new status descriptions
2014-09-04 09:29:31 +02: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
VilhoRaatikka
7fcf950f8f Merge branch 'Z3' of https://github.com/skysql/MaxScale into Z3
Conflicts:
	server/modules/routing/readwritesplit/readwritesplit.c
2014-09-03 22:54:32 +03:00
VilhoRaatikka
cda39a62fb Fixes to
Includes imprvements to hints processing. If hint can't be followed query is routed possibly to slave, and eventually to master if other attempts fail.
2014-09-03 22:09:50 +03:00
VilhoRaatikka
5e5c59d322 Merge branch 'MAX-237' into Z3 2014-09-03 17:50:56 +03:00
Hartmut Holzgraefe
6a03976e4f support --long options with getopt_long() 2014-09-03 01:03:10 +02:00
Markus Makela
cc5922b218 Merge branch 'MAX-237' into Z3 2014-09-02 16:58:20 +03:00
VilhoRaatikka
0fed5c2c5b Fix to bug #510, http://bugs.skysql.com/show_bug.cgi?id=510, made every MaxScale thread to call mysql_thread_init() before entering poll_waitevents. Also main thread does this before starting services. Removed all calls to mysql_thread_init() and to mysql_thread_end() from elsewhere than from poll.c:poll_waitevents and from gateway.c:main
skygw_utils.cc: replace_literal: fixed memory leak
2014-09-01 19:37:31 +03:00
Mark Riddoch
a4ae7ea139 Fix for bug 493 - Multiple config file sections with the same name 2014-09-01 17:18:15 +01:00
Mark Riddoch
60d6b5b699 Fix bugs 484 and 485. 2014-09-01 16:51:05 +01:00
Markus Makela
164d8b1e32 Fixed various memory leaks
dbuser.c: key.user value was never freed
skygw_utils.cc: replace_literal values were not always freed
2014-09-01 13:40:52 +03: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
counterpoint
eed40fef75 Extend hashtable scripts, fix hashtable with size of less than 1; correct text in spinlock tests. 2014-08-27 09:31:34 +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
Mark Riddoch
493feb49ba Fix for bug 410 - MaxScale.cnf server option is not parsed for spaces 2014-08-22 14:46:26 +01:00
Mark Riddoch
c133c6ef4a Fix for bug 479 - Undefined filter reference in MaxScale.cnf causes a crash 2014-08-22 14:33:14 +01:00
Mark Riddoch
3476558f52 Fixed soem errors from a cppcheck run
mbrampton@martin-office:~/Dropbox/development/skygit/MaxScale/server$ cppcheck -q core/*.c
[core/adminusers.c:302]: (error) Resource leak: fp_tmp
[core/filter.c:382]: (error) Uninitialized variable: me
[core/service.c:1071]: (error) Uninitialized variable: succp
2014-08-22 14:25:27 +01:00
VilhoRaatikka
4a2d81e066 Merge branch 'MAX-160' of https://github.com/skysql/MaxScale into MAX-160 2014-08-20 22:19:51 +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
Markus Makela
e329d8cf13 Fix to bug #479, http://bugs.skysql.com/show_bug.cgi?id=479
service.c was counting unfound filters towards the filter chain size.
2014-08-20 15:15:45 +03:00
Mark Riddoch
baa655182c Merge branch 'master' into develop 2014-08-20 11:07:55 +01:00
Mark Riddoch
24e16e97ed Updates for unit tests 2014-08-20 11:07:28 +01:00
Mark Riddoch
d6a2ef6996 Misc fixes to doxygen comments 2014-08-19 13:22:40 +01:00
Mark Riddoch
3dc09dfe43 Addition of spinlock unit test 2014-08-18 18:26:14 +01:00
Hartmut Holzgraefe
d355e07e2d gitignore cleanup
* ignore typical backup files created by common editors
* move general ignore rules like "*.o" or "depend.mk" to top level gitignore
* ignore executables and test directories in target dir gitignore
  as these are local and there's no general catch-all pattern for them
2014-08-18 09:39:29 +00:00
Vilho Raatikka
34f6884920 Merge pull request #24 from hholzgra/hartmut-DEL
Hartmut del
2014-08-18 09:20:30 +03:00
Vilho Raatikka
087c4720bb Merge pull request #23 from hholzgra/hartmut-DEL
Hartmut del
2014-08-18 09:20:03 +03:00
Hartmut Holzgraefe
fb87f68368 consistently use DEL instead of rm in Makefiles 2014-08-17 21:02:24 +00:00
VilhoRaatikka
677a44f497 Merge from release-1.0beta to Z2 2014-08-15 18:00:39 +03:00
VilhoRaatikka
902004c1ee Fix to bug #463, http://bugs.skysql.com/show_bug.cgi?id=463
mysql_common.c:gw_MySQL_get_next_packet didn't handle case where an insert command followed by alter table in the same read buffer. It shouldn't been possible without multi-statement being set.
2014-08-14 22:33:57 +03:00
VilhoRaatikka
77e5525436 mysql_client.c:gw_error_client_event & gw_client_hangup_event: added session state check, if session is already closing, don't start redundant call to dcb_close.
mysql_common.c:mysql_protocol_done: added protocol state check. Used not to check it which caused double free of allocated memory.
2014-08-14 15:15:22 +03:00
Markus Makela
3a639403bf added fixes to core tests failing even though they passed, hint syntax test only checking for a partial logfile and readwritesplit tests being run twice. 2014-08-11 14:27:33 +03: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
183428c48b Fix to bug #470, http://bugs.skysql.com/show_bug.cgi?id=470, in hint_dup: the value field of the duplicated hint was not set. Instead data field was set twice. 2014-08-07 00:14:15 +03:00