143 Commits

Author SHA1 Message Date
Markus Makela
a2bff1dcea Merge branch 'develop' into MAX-324 2015-02-16 14:58:35 +02:00
Mark Riddoch
9dfa4378b4 Merge branch 'develop' of https://github.com/mariadb-corporation/MaxScale into develop 2015-02-16 09:21:38 +00:00
Mark Riddoch
d7da8c5297 Code cleanup 2015-02-16 09:21:11 +00:00
Hartmut Holzgraefe
617f44c9c9 use intptr_t type for pointer->integer conversion so that int <-> pointer sizes match 2015-02-14 16:39:05 +01:00
Markus Makela
9177b6bcd3 Merge branch 'develop' into MAX-324
Conflicts:
	query_classifier/query_classifier.h
2015-01-13 06:34:22 +02:00
VilhoRaatikka
333f79f4db Commented session id logging. 2015-01-12 14:44:53 +02:00
Markus Makela
fed828eb29 Merge branch 'release-1.0GA' into MAX-324
Conflicts:
	server/MaxScale_template.cnf
	server/core/service.c
2015-01-06 04:45:30 +02:00
VilhoRaatikka
8f570082eb poll.c:poll_add_event_to_dcb didn't update pollStats.evq_pending when added event became pending. That may cause threads to run in poll loop with minimal timeout infinitely. Added counter update. 2014-12-15 22:21:23 +02:00
VilhoRaatikka
7fed679f40 poll.c:poll_add_event_to_dcb did not increase the pollStats.evq_pending counter which caused it to go negative, which, inturn caused all threads to spinloop with minimal timeout. 2014-12-15 22:09:23 +02:00
VilhoRaatikka
a4968f2521 Complete fix candidate for #645, http://bugs.skysql.com/show_bug.cgi?id=645 and #648, http://bugs.skysql.com/show_bug.cgi?id=648
tee.c:closeSession removed unnecessary dcb_free, router/service closes all backend DCBs and the client DCB, and client DCB is the one that was tried to free in closeSession.
readwritesplit.c:routeQuery now handles untyped and typed GWBUFs. Untyped means that read buffer may consist of incomplete and multiple MySQL packets. Typed buffer always consists of a single MySQL packet (which can be split to many buffers inside GWBUF).
Fixed Coverity cases #84840 and #84841
2014-12-14 11:26:15 +02:00
Mark Riddoch
5fa87776b0 Fixes for Coverity bugs 2014-11-20 16:04:22 +00:00
Markus Makela
a65b9fa8b3 Fixes to Coverity defects: 72662 82143 82144 82145 82348 82349 2014-11-20 06:44:43 +02:00
Mark Riddoch
d3c8770852 Merge branch 'blr' into develop
Conflicts:
	client/maxadmin.c
	server/core/CMakeLists.txt
	server/core/dcb.c
	server/core/gateway.c
	server/core/poll.c
	server/core/test/CMakeLists.txt
	server/core/test/makefile
	server/include/poll.h
	server/modules/routing/debugcmd.c
2014-11-19 12:00:55 +00:00
VilhoRaatikka
fd11e6a7f5 Session-specific logging. Added functions
void session_enable_log(SESSION* ses, logfile_id_t id)
and
void session_disable_log(SESSION* ses, logfile_id_t id)

Which switch specific log type on/off if the log type in question is not generally enabled.

Each thread carries a thread-specific struct log_info_t which includes members for current session id and bitfield for enabled log types for the current session. That information is checked before actual log write functions are called.

Each file where session-specific logging is used, must include the following exports:

/** Defined in log_manager.cc */
extern int            lm_enabled_logfiles_bitmask;
extern size_t         log_ses_count[];
extern __thread log_info_t tls_log_info;
2014-11-19 00:08:59 +02:00
VilhoRaatikka
a30fc0c787 MAX-328, Add session identifier to trace log entries. Session id is given to session in session_alloc and stored to thread's local storage variable when thread picks a new event from epoll_wait. 2014-11-17 23:27:14 +02:00
VilhoRaatikka
061fa62d29 Fixes to Coverity issues 77197 (mysql_common.c, dcb.c, mysql_client.c, skygw_debug.h), 72654 (poll.c), 72756 (mysql_backend.c), 72744 (mysql_backend.c), 77197 (mysql_common.c), 72746 (mysql_common.c), 72676 (mysql_common.c), 72705 (readwritesplit.c), 72697 (readwritesplit.c), 72652 (skygw_debug.h) 2014-11-11 14:10:06 +02:00
VilhoRaatikka
9a5168c3e8 Put errors ganerating code behind FAKE_CODE macro, which is not defined by default in any build. 2014-11-10 15:22:08 +02:00
VilhoRaatikka
6ed8836b15 dcb.c:dcb_close prevent redundant execution of dcb_close for one DCB 2014-11-03 22:07:54 +02:00
VilhoRaatikka
60536f622e Fix to bug #590, http://bugs.mariadb.com/show_bug.cgi?id=590
Added function poll.c:poll_add_epollin_event_to_dcb which adds given event and related GWBUF to given DCB. The DCB is then added to event queue list so that its even becomes executed as soon as any of the threads start to process events next time.
The problem solved is case where COM_CHANGE_USER failed due to authentication failure. An error should be sent to the client but it was sent once per failed backend authentication instead of just once.
Thread which failed in authentication bypassed router and thus replies weren't filtered out. Solution adds an event and a GWBUF including error message to DCB and the DCB is then added to event queue. Thus the error message appeares like it was an incoming event and becomes processed properly.

An addition was made to mysql_backend.c:gw_read_backend_event so that self-generated event can be processed. Even if socket read doesn't manage to read anything, function proceeds if there is enough data in DCB's readqueue.

Fix ti bug #602, http://bugs.mariadb.com/show_bug.cgi?id=602
Added function sescmd_response_complete which checks if the read data completes session command response packet(s). Function is called only if there's a sessoin command being executed.
2014-10-30 16:54:27 +02:00
Mark Riddoch
9e0a8a0eee Addition of show eventstats 2014-10-23 13:38:46 +01:00
Mark Riddoch
70672e43a1 Addition of backoff process for master reconnect
Housekeeper task display
2014-10-23 10:46:55 +01:00
Mark Riddoch
e729a17fd4 Addition of new tuning parameters for epoll spins and wait time 2014-10-17 12:28:27 +01:00
Mark Riddoch
f459bdfe04 Add new command to view the event queue
Fixes to fake poll events to improve fairness
2014-10-17 08:36:32 +01:00
Markus Makela
ebb3b52fdb Included the my_config.h header before any system headers if mysql headers were used. 2014-10-10 12:30:21 +03:00
counterpoint
57ad30f105 Fuller message in asserts. 2014-10-07 09:08:49 +01:00
Mark Riddoch
8986a8042e Addition of averages for event queue pending events 2014-10-03 14:35:19 +01:00
Mark Riddoch
829a4bcbfa Refinement of polling process 2014-10-02 17:19:18 +01:00
Mark Riddoch
9186d3fa90 Fixes for blr_salve performanc issues, linking of embedded library,
housekeeper heartbeat addition and unloading of modules to allow
profiling of modules using LD_PROFILE environment variable and sprof
2014-10-01 18:30:13 +01:00
Markus Makela
b0683d9b4d Updated the licensing year from 2013 to 2013-2014 2014-10-01 14:37:12 +03:00
Mark Riddoch
0ef87e3cc1 Updates to slave catchup mode to use fake events
Addition of fake EPOLLOUT event mechanism

New memlog feature for debugging purposes
2014-09-30 13:25:45 +01:00
Markus Makela
f4e591e382 Changed 'SkySQL Gateway' to 'MariaDB Corporation MaxScale' 2014-09-30 13:15:03 +03:00
Markus Makela
c344231f80 Renamed all occurences of SkySQL to MariaDB Corporation 2014-09-30 13:02:10 +03:00
Mark Riddoch
3430fc99d2 Shutdown fix in housekeeper
In memory logging in blr_master
2014-09-26 12:36:59 +01:00
Mark Riddoch
0d19857a1f Fix for debug build 2014-09-25 14:56:54 +01:00
Mark Riddoch
2183dbcc28 Performance improvement 2014-09-25 12:00:19 +01:00
Mark Riddoch
dff6fff888 Fixed missing return in process_pollq and added mysql.h to get rid of
warning about mysql_thread calls
2014-09-25 11:36:17 +01:00
Mark Riddoch
3ac3a60229 Prevent epoll_wait call with a timeout if there are events in the queue to be processed 2014-09-25 11:10:30 +01:00
Mark Riddoch
63252e94f2 Merge branch 'release-1.0beta-refresh' into blr
Fix conflict and remove some redundant code

Conflicts:
	server/core/poll.c
2014-09-24 16:49:12 +01:00
Mark Riddoch
92ce8a47ba Introduction of a new polling mechanism to make the thread usage more fair and avoid
having busy DCB's being able to block execution of events on less busy DCBs
2014-09-24 16:34:34 +01:00
Mark Riddoch
7562d49a95 Addition rtdsc for tracing purposes 2014-09-23 22:09:36 +01:00
Mark Riddoch
2c0b549b58 Merge branch 'release-1.0beta-refresh' of github.com:skysql/MaxScale into release-1.0beta-refresh 2014-09-23 12:04:37 +01:00
VilhoRaatikka
b12415c054 Fix to #537, http://bugs.skysql.com/show_bug.cgi?id=537
mysql_thread_end was never called in this function
2014-09-23 12:33:30 +03:00
VilhoRaatikka
45f8585804 Fix to bug #549, http://bugs.skysql.com/show_bug.cgi?id=549
Each monitor loops 10 times/second (sleep 100ms) and perform monitoring checks only when monitor's interval is spent. Monitors notice faster if the shutdown flag is set and thus overall shutdown is faster.
hint.c:added missing header
Changed interval from unsigned long to size_t which is guaranteed to be of same size also in windows (if possible).
2014-09-23 11:26:15 +03:00
Mark Riddoch
a71971cf53 Make EPOLLRDHUP conditional to allow CentOS5 builds 2014-09-23 08:04:45 +01:00
Mark Riddoch
2d2fc28b07 Addition of code to prevent multiple hangup's beign processed on the same
DCB
2014-09-19 11:40:16 +01:00
Mark Riddoch
2402d55de6 Some general tidyup plus addition of code to block zombie processing
if epoll_wait returned multiple descriptors
2014-09-19 10:50:54 +01:00
VilhoRaatikka
0f3db1c091 First changes for fixing #548, http://bugs.skysql.com/show_bug.cgi?id=548
dcb.c:dcb_process_zombies:added new parameter which tells what DCB the thread will use after calling dcb_process_zombies. Thus, processing that DCB is skipped.
readwritesplit.c:routeQuery:removed double free call for query buffer.
2014-09-17 18:02:44 +03:00
MassimilianoPinto
8b5b4a17fe Merge from Z3
Merge from Z3
2014-09-11 12:51:16 +02: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