91 Commits

Author SHA1 Message Date
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
Mark Riddoch
787483f71c Merge branch 'develop' into MAX-90 2014-06-30 16:20:11 +01:00
Mark Riddoch
6c1960e53b Increase accuracy of percentages for connection distribution. 2014-06-30 16:16:27 +01:00
MassimilianoPinto
32526d31b6 code cleanup
code cleanup
2014-06-27 18:14:46 +02:00
MassimilianoPinto
5cbc7b9f7d root server IN_MAINT returns NULL to caller
the replication tree returns NULL if the root server is maintenance mode
2014-06-27 17:55:46 +02:00
Mark Riddoch
a25b757134 Merge branch 'develop' into MAX-90
Conflicts:
	server/core/server.c
	server/include/server.h
	server/modules/routing/readconnroute.c
2014-06-27 16:04:39 +01:00
Mark Riddoch
ce2d20b70c Fixed printf format 2014-06-27 15:52:57 +01:00
Mark Riddoch
25d4f784bc Implementation of server routing generic functionality and for readconnrouter 2014-06-27 12:07:47 +01:00
MassimilianoPinto
c13275c0e7 merge from develop
merge from develop
2014-06-26 21:27:22 +02:00
MassimilianoPinto
52646a9942 Fix compile warning
Fix compile warning
2014-06-26 21:22:33 +02:00
MassimilianoPinto
a351a5eb09 fix compile warning
fix compile warning
2014-06-26 21:17:49 +02:00
MassimilianoPinto
f246219beb Fix compile errors and warnings
Fix compile errors and warnings
2014-06-26 18:20:33 +02:00
MassimilianoPinto
1a33277f72 Merge from develop
Merge from develop
2014-06-26 17:08:21 +02:00
MassimilianoPinto
5a65bc2aaa get_root_master routine available
get_root_master routine available
2014-06-25 17:19:14 +02:00
VilhoRaatikka
1d1da398d4 Merge branch 'develop' into MAX-99
Conflicts:
	server/modules/routing/readwritesplit/readwritesplit.c
2014-06-25 17:50:29 +03:00
VilhoRaatikka
7ff14e23a5 Support for prepared statement, namely support for following comands : COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_RESET, COM_STMT_CLOSE, SQLCOM_PREPARE, SQLCOM_EXECUTE, SQLCOM_DEALLOCATE_PREPARE (DEALLOCATE/DROP PREPARE stmt).
All prepare commands are executed in every backend server currently connected.

All executes are routed to master. If stmt type was recorded in prepare phase in rwsplit router, read-only stmts could be routed to slaves.

COM_STMT_PREPARE gets arbitrary number of response packets from backend database. Since statements are prepared in every backend server and only one multi-packet response can be replied to client, redundant multi-packet responses are discarded. This is done in router. Mechanisms from session command handling are utilized with little changes: router must identify when response consists of multiple packets so that it knows to calculate the number of packets in response and that it is able to discard correct number of packets.

Information to the reply-handling router is provided by backend protocol, which includes a ordered list of commands of commands sent to protocol-owning backend server. A command is stored to protocol struct in mysql_backend.c:gw_MySQLWrite_backend if the statement buffer's type has GWBUF_TYPE_SINGLE_STMT set in mysql_client.c:route_by_statement. GWBUF_TYPE_SINGLE_STATEMENT indicates that there is single statement in the buffer, as opposite to Read Connection router, which accepts streaming input from client.
2014-06-25 17:15:46 +03:00
MassimilianoPinto
2eafe15bca Added master_host update in the loop
Added master_host update in the loop, returns the right server in case
of multiple servers with same replication depth
2014-06-25 15:51:29 +02:00
MassimilianoPinto
52ef3b6718 New rules for selecting Master/Slaves
New rules for selecting Master/Slaves are based on MySQL depth in the
replication tree.
The only Master is the root server with SERVER_MASTER bit set
All other servers even with both SLAVE and MASTER bit will be selected
as slaves
2014-06-24 15:44:14 +02:00
Mark Riddoch
4d257897d3 Merge branch 'develop' of github.com:skysql/MaxScale into develop
Conflicts:
	server/core/session.c
	server/modules/protocol/mysql_backend.c
	server/modules/routing/readwritesplit/readwritesplit.c

Resolved.

Addition of user in topfilter report and general tidyup
2014-06-18 17:45:57 +01:00