109 Commits

Author SHA1 Message Date
Markus Makela
9da0c206bb Added missing brackets
Some curly braces were missing from readconnroute and some function declarations
were misaligned.
2015-12-02 13:36:18 +02:00
Markus Makela
45abfeec2c Fix to MXS-494: Fixed readconnroute weight calculation
The calculation of weights used the actual amount of connections instead of
actual amount of connections + 1. This lead to the weight being effectively
ignored for servers with no connections.
2015-12-02 13:36:18 +02:00
Markus Makela
91eba965fc Formatted readconnroute
Formatted readconnroute files according to the style guide.
2015-12-02 13:36:18 +02:00
Markus Makela
2e127ef38e Fix to MXS-429: Missing parameter no longer causes a crash
If a server is missing a weighting parameter the default weight will be used.
2015-12-01 12:22:47 +02:00
Johan Wikman
fb443a9f92 LOGIF removed from readconnroute.c 2015-11-17 12:48:47 +02:00
Markus Makela
30d1fc66b7 getCapabilities no longer takes arguments and returns an int. 2015-11-11 18:14:03 +02:00
counterpoint
dee20fe077 Merge remote-tracking branch 'origin/develop' into MXS-329-develop-20151111
# Conflicts:
#	server/core/CMakeLists.txt
#	server/core/buffer.c
#	server/core/service.c
#	server/modules/filter/tee.c
#	server/modules/monitor/mysql_mon.c
#	server/modules/routing/binlog/blr.c
#	server/modules/routing/binlog/blr_slave.c
#	server/modules/routing/debugcmd.c
#	server/modules/routing/readwritesplit/readwritesplit.c
#	utils/skygw_utils.cc

- resolved.
2015-11-11 11:08:02 +00:00
counterpoint
72072778de Consume the given buffer in all cases, as caller has to assume that this will take place. 2015-11-11 08:39:47 +00:00
Johan Wikman
834a88aeda Log variables moved to log_manager.h
The log manager variables lm_enabled_log_files_bitmask, log_ses_count
and tls_log_info that earlier were declared separately in every
c-file are now declared in the log_manager.h header.
2015-11-04 14:26:53 +02:00
counterpoint
1b04a0cf91 Fix issues with error handling needing to cater for both client and backend DCBs. 2015-11-02 16:27:44 +00:00
counterpoint
e38ea9d07d Correct missing return value. 2015-10-02 16:19:59 +01:00
counterpoint
2231d0870c Place checks in callback routines because DCB will not always contain a reference to a router session, and the associated data will be invalid in this case. 2015-09-25 12:17:18 +01:00
counterpoint
88716c35fb Various changes to block loopholes in different cases and tidy up. 2015-09-21 09:23:22 +01:00
counterpoint
fdbe070e80 Change abort to error message when read connection router finds mismatch between router client session DCB and given backend DCB; improve order of actions when closing DCB in read-write router. 2015-09-15 15:22:44 +01:00
counterpoint
f6916a23bd Move responsibility for closing DCB on error to router error handling. Check that routers remove or disable links to closed DCB. 2015-09-09 09:33:00 +01:00
counterpoint
2e50dfd484 Readjust indentation in handleError function of read connection router. 2015-09-09 08:37:40 +01:00
counterpoint
986c918d52 Remove ERRACT_RESET action from router error handler; remove sole call from mysql_client. Correct comments on parameters for router error handlers. 2015-09-09 08:31:59 +01:00
Martin Brampton
4a1ad3df69 Attempt solution to crash caused by leaving link to backend DCB in router session. 2015-09-05 08:53:19 +01:00
Markus Makela
78eab19c62 Fixed compiler warnings. 2015-07-14 17:13:09 +03:00
Markus Makela
6497350ab7 Merge branch 'release-1.2' into develop
Conflicts:
	server/core/adminusers.c
	server/modules/protocol/mysql_client.c
2015-07-11 17:12:48 +03:00
Markus Makela
fb09cbf100 Fixed queries being routed when the session is already closing. 2015-07-07 13:15:23 +03:00
counterpoint
09fdb0a2c2 Hopefully final tidy up. 2015-06-23 14:58:53 +01:00
counterpoint
d0e92a15f8 Move decrement of server connections into zombie processing; introduce dcb_close_finish to be called either in dcb_close or when persistent dcb is discarded. 2015-06-09 11:41:43 +01:00
Markus Makela
3fb59e020b Added more logging to trace log. 2015-04-09 22:07:53 +03:00
Markus Makela
8c36a45c69 Updated some logging to be only done if the logfiles are enabled. 2015-03-25 11:18:46 +02:00
Markus Makela
5c68782050 Added more trace logging to readcounnroute, schemarouter and tee. 2015-03-24 21:28:03 +02:00
Markus Makela
3a50b308b0 Set CPack RPM packaging version to 1 and added a RUNNING option to readconnroute. 2015-03-19 20:11:22 +02:00
Markus Makela
b4f5a4eb9f Fix to MXS-32: https://mariadb.atlassian.net/browse/MXS-32
readconnroute now accepts RUNNING as server status when no router_options are given.
2015-03-19 15:44:14 +02:00
VilhoRaatikka
113ea8381b Complamentary fix to #694, added error flag reset to readconnrouter as well. 2015-01-16 11:56:20 +02:00
Markus Makela
b3d79f7273 Merge branch 'release-1.0GA' into bug_679_fix 2015-01-02 20:57:28 +02:00
Markus Makela
95cd0b93cb Fix to bug 679: http://bugs.mariadb.com/show_bug.cgi?id=679
Added server references to services instead of using a raw pointers to server instances.
Changed all references to service->database to service->dbref.
2015-01-02 20:55:38 +02:00
VilhoRaatikka
6228be4284 Fix to bug #678, http://bugs.skysql.com/show_bug.cgi?id=678
tee.c:routeQuery cloned partial MySQL packets to be routed to child router. Problems were due to the use of gwbuf_clone and modutil_MySQL_query which clone/examine only the first buffer from the buffer list which composes GWBUF.
modutil.c: Added function modutil_MySQL_query_len which calculates MySQL packet length and the missing bytecount
2015-01-02 18:32:57 +02:00
VilhoRaatikka
b0c152b55c Fixed debug assertion and protected read of client DCB's state and consistency. 2014-12-30 10:55:53 +02:00
VilhoRaatikka
635fcf708f Fix to bugs #665, and #664. Potentially to #649.
http://bugs.skysql.com/show_bug.cgi?id=665
http://bugs.skysql.com/show_bug.cgi?id=664
http://bugs.skysql.com/show_bug.cgi?id=649

dcb.c:dcb_final_free: (665):set dcb->session->client pointer to NULL so that it won't be read anymore and other threads won't try to close it.
	dcb_final_free:(664):don't free dcb->data, it is either freed in session_alloc if session creation fails or in session_free only.
session.c:if session creation fails, free dcb->data and remove links between client DCB and session.
mysql_backend.c:(665):gw_backend_close:check that session->client isn't NULL and that client DCB's state is still polling before calling dcb_close for it.
mysql_client.c:gw_mysql_do_authentication:if anything fails, and session_alloc won't be called, free dcb->data.
mysql_common.c:gw_send_authentication_to_backend:if session is already closing then return with error.
2014-12-29 20:19:01 +02:00
Markus Makela
a199a32301 Addition to bug 658 fix: http://bugs.mariadb.com/show_bug.cgi?id=658
readconnroute.c:Added backend state change handling.
2014-12-23 13:16:24 +02:00
Markus Makela
0ade57e56e Fix to bug 658: http://bugs.mariadb.com/show_bug.cgi?id=658
readconnroute.c:Added a check for server status before routing the query.
2014-12-23 11:14:19 +02:00
Mark Riddoch
ce056dccd8 Update modue status of all GA modules 2014-12-08 09:19:35 +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
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
VilhoRaatikka
9ccbab1899 poll.c:dcb_close Don't call poll_remove_dcb anymore if DCB has already been removed from poll set.
mysql_backend.c, mysql_client.c free error message GWBUF after calling handleError
readconnroute.c:handleError send error message to client before returning.
readwritesplit.c:handleError don't free error message buffer anymore since the caller of handleError frees it.
2014-11-01 20:00:59 +02:00
VilhoRaatikka
00fded016b Fixes to Coverity tasks : 73267, 72686, 72672
Cleaned up warnings, and added checks to malloc return values and error log writes in case of failures.
2014-10-31 15:25:59 +02:00
VilhoRaatikka
aca8596efa mysql_client.c:gw_client_close didn't close client session in cases where session->state == SESSION_STATE_STOPPING. That is a bug and lead to situation where session wasn't closed at all.
Also changed 'authorization failed' to 'access denied'
mysql_common.c: fixed memory leak in gw_receive_backend_auth, and replaced error code '2800' with '28000'.
readconnroute.c:handleError didn't set *succp pointer so uninitialized value was used in caller's context.
makefile.inc: added -lm to linker flags
mysql_backend.c: added a few comments
2014-10-06 11:46:12 +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
d5e2410fe6 Fix for zero wieght in readconnrouter 2014-09-15 14:53:08 +01: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
Mark Riddoch
4af2e58c86 Update plugin status to BETA 2014-07-04 09:23:40 +01:00
MassimilianoPinto
e586efcaae Comments updated in get_root_master
Comments updated in get_root_master
2014-07-01 16:03:22 +02:00
MassimilianoPinto
794438a248 Bug fix in get_root_master
bug fix in get_root_master if there is a server outside of the
replication tree or not monitored
2014-07-01 12:31:42 +02:00