104 Commits

Author SHA1 Message Date
Johan Wikman
2afe60dd0e Reindent server/core/dcb.c 2015-11-30 12:42:13 +02:00
counterpoint
6e9a2a89eb Add dcb_hangup_foreach to DCB header. 2015-10-17 20:09:05 +01:00
counterpoint
12922225b8 Remove redundant DCB state DCB_STATE_FREED, remove obsolete assertion from poll.c, tidy up. 2015-08-25 09:11:44 +01:00
counterpoint
65c42e2d80 Move removal of closing DCB from poll list to the kill zombies processing, rather than immediately on close; modify persistent connections to obtain candidates for the pool from the kill zombies processing to be sure that they really are finished all previous processing. 2015-08-24 16:19:25 +01:00
counterpoint
4f5de063eb Merged dcb_read and dcb_read_n into a single function (dcb_read with an extra parameter). 2015-07-10 15:12:22 +01:00
counterpoint
ba417ef633 Merge remote-tracking branch 'origin/develop' into MXS-122
Conflicts:
	server/core/dcb.c
2015-07-08 14:54:22 +01:00
counterpoint
fffd8fb73a Unify DCB close processing to single function dcb_close. Remove dcb_add_to_zombieslist (incorporating logic into dcb_close). Alter logic so that DCB that is just allocated will still go to zombie list if dcb->fd is not closed. 2015-07-07 16:57:12 +01:00
counterpoint
18a95eeb71 Simplify adding and removing DCBs from polling, improve error handling. Remove dcb_set_state functions as not adding value. 2015-07-07 16:57:12 +01:00
counterpoint
a72f462e2d Fixes for MXS-196 and other related problems. 2015-07-07 16:57:12 +01:00
counterpoint
b880350cf3 Complete merge of latest develop branch 2015-06-22 10:39:13 +01:00
Martin Brampton
4c38e2224b Merge remote-tracking branch 'origin/develop' into MXS-122
Conflicts:
	server/core/CMakeLists.txt
	server/core/dcb.c
	server/include/dcb.h
	server/include/server.h
	server/modules/protocol/mysql_backend.c
2015-06-19 23:12:54 +01:00
counterpoint
267e702dcd Various fixes and code tidying. 2015-06-10 11:28:25 +01:00
Markus Makela
de2910f75b Fixed SSL_accept failing if the GWBUF with the initial MySQL auth packet contains some of the SSL authentication data. 2015-06-09 22:27:15 +03:00
counterpoint
99e9987f9b Clear persistent pool DCBs when server freed. 2015-06-09 08:26:14 +01:00
counterpoint
e395ab1442 Provide explicit time checking for age of persistent DCBs. 2015-06-03 16:47:02 +01:00
counterpoint
1a76fc141d Add configuration capabilities for persistent connections. 2015-06-02 15:44:57 +01:00
Markus Makela
fc8918b1f2 Added a dcb_connect_SSL function which starts a client SSL connection. 2015-06-02 09:15:08 +03:00
Markus Makela
d7232d8b6e Moved SSL structure to the DCB instead of the MySQL protocol.
This allows for non-MySQL SSL connections.
2015-06-01 20:51:26 +03:00
Markus Makela
0f814d3e73 Added SSL write and read functions. 2015-05-29 13:00:37 +03:00
counterpoint
23e9a7b4e2 Try out some more changes. 2015-05-27 16:41:06 +01:00
counterpoint
6c5e6a5959 Move code around to fix headers problem etc. 2015-05-27 10:17:35 +01:00
counterpoint
fccb9df817 Add more status information to maxadmin displays 2015-05-26 14:54:32 +01:00
counterpoint
d7cd40e5a5 Bug fixes and improvements. 2015-05-22 15:53:54 +01:00
counterpoint
6f31357372 Initial changes for persistent connections - add some basic functionality. 2015-05-20 18:15:11 +01:00
Markus Makela
5fb9353b47 Added session idle time and user name the client is connecting with to the dprintSession and dprintAllSessions functions. Also changed last_read from time_t to unsigned long to match the hkheartbeat. 2015-03-13 08:49:34 +02:00
Markus Makela
1b0fd4576a Merge branch 'maxinfo' into develop
Conflicts:
	server/core/service.c
	server/core/session.c
	server/include/session.h
2015-03-04 11:33:00 +02:00
Markus Makela
c47d2f3791 Added session timeouts.
The parameter 'connection_timeout' for services takes a value as seconds.
All sessions that have been idle for longer than this will be disconnected.
2015-02-20 22:16:43 +02:00
Mark Riddoch
8eb14235d1 Addition of DCB and Poll statistics in show status output 2015-02-20 10:05:50 +00:00
Markus Makela
da029140cd dcb_call_foreach now only calls the callbacks for those DCBs that are connected to the server. 2015-02-18 05:36:39 +02:00
MassimilianoPinto
98cbc34c6c Fix for bug #714
Fix for bug #714
2015-02-06 11:26:48 +01:00
Markus Makela
e6607dca40 tee.c:
Added clientReply and setUpstream entry points
    Tee filter now waits for the branch session to be replied to and if the reply isn't received in five seconds it closes the branch session.
dcb.h:
    Added the DCBF_REPLIED flag that is currently only set in dcb_null_write
dcb.c:
    The DCBF_REPLIED flag is now set in dcb_null_write
2014-12-30 17:40:47 +02:00
VilhoRaatikka
f0d8ed0cf2 Fix to #657, http://bugs.mariadb.com/show_bug.cgi?id=657
session.c:session_free:if session is child of another service (tee in this case), it is the parent which releases child's allocated memory back to the system. This now also includes the child router session.
dcb.h: Added DCB_IS_CLONE macro
tee.c:freeSession:if parent session triggered closing of tee, then child session may not be closed yet. In that case free the child session first and only then free child router session and release child session's memory back to system.
tee.c:routeQuery: only route if child session is ready for routing. Log if session is not ready for routing and set tee session inactive
mysql_client.c:gw_client_close:if DCB is cloned one don't close the protocol because they it is shared with the original DCB.
2014-12-23 00:26:57 +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
43ed77b52b Bug 515 Conditional arguemnt to gw_write 2014-11-19 16:43:21 +00: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
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
62270412cf readwritesplit.c: prevent switching the master during session. Added logging to cases where master has changed.
Moved DCB's member errhandle_called behing DEBUG flags to Release build. It shows if handleError is called for a DCB and makes it possible to avoid redundant calls.
2014-11-10 14:15:32 +02:00
Mark Riddoch
9e0a8a0eee Addition of show eventstats 2014-10-23 13:38:46 +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
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
c4ca1ddb13 Updated non-source files with new company name. 2014-10-01 15:21:47 +03:00
Markus Makela
b0683d9b4d Updated the licensing year from 2013 to 2013-2014 2014-10-01 14:37:12 +03: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
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
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