2236 Commits

Author SHA1 Message Date
VilhoRaatikka
beacd524da Fix to bug #662, http://bugs.mariadb.com/show_bug.cgi?id=662
dbusers.c: Added function for setting read, write and connection timeout values. Set default timeouts for getUsers. Defaults are listed in service.c
gateway.c:shutdown_server is called whenever MaxScale is to be shut down. Added call for service_shutdown to shutdown_server.
service.c:service_alloc: replaced malloc with calloc and removed unnecessary zero/NULL initialization statements as a consequence.
	serviceStart: Exit serviceStartPort loop if shutdown flag is set for the service.
	serviceStartAll: Exit serviceStart loop if shutdown flag is set for the service.
service.c: Added service_shutdown which sets shutdown flag for each service found in allServices list.
service.h: Added prototype for service_shutdown
2014-12-29 13:45:24 +02:00
VilhoRaatikka
5e3d90b8b0 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-23 18:13:32 +02:00
VilhoRaatikka
8e1e72132b Fix to #645, http://bugs.mariadb.com/show_bug.cgi?id=654
NULL-terminated argument list in case where there are given more arguments than expected.
2014-12-23 18:12:23 +02:00
Markus Makela
a1d7ccac2f Commented out a debug assert in dcb.c:917 2014-12-23 17:40:22 +02:00
VilhoRaatikka
ff5fe23ce6 dcb.b:dcb_final_free:replaced ((dcb->flags & DCBF_CLONE)==0) with macro !DCB_IS_CLONE(dcb)
readwritesplit.h:Removed invalid macros which assumed that ROUTER_CLIENT_SES->rses_backend_ref always pointed to valid and used backend reference and thus included potential risk of NULL-pointer refernce.
mysql_backend.c and mysql_client.c:avoid executing CHK_PROTOCOL(p) after original DCB has been released the memory.
readwritesplit.c:Replaced RSES_CLEINT_DCB macro with a function which returns client DCB for a given router client session.
2014-12-23 16:10:27 +02:00
VilhoRaatikka
d2281d6391 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-23 13:37:12 +02:00
VilhoRaatikka
51315c0764 Fixed a memory leak in tee.c:freeSession, where tee session wasn't freed 2014-12-23 13:36:05 +02:00
Vilho Raatikka
05c917f9f1 Merge pull request #69 from mariadb-corporation/bug_658_fix
Addition to bug 658 fix: http://bugs.mariadb.com/show_bug.cgi?id=658
2014-12-23 13:25:09 +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
3826f41007 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-23 11:15:48 +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
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
61fcc1e21e Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-22 16:45:31 +02:00
VilhoRaatikka
6b6ac2f95f Partial fix to bug #657, http://bugs.mariadb.com/show_bug.cgi?id=657
dcb.c:dcb_clone: set same close function than in the original DCB so that routing session will become closed when client DCB is closed.
session.h:introduce a new state which indicates that SESSION structure can be freed next, SESSION_STATE_TO_BE_FREED. State is needed to separate the state before and after memory free. Memory is freed in different situation depending on whether the session is parent or child session. Child sessions are freed in their parent.
Also introduce a new member in SESSION struct, ses_is_child, to indicate whether SESSION has a parent session which is responsible for releasing the memory of it.

session.c:session_unlink_dcb:when last session reference is removed set SESSION->state=SESSION_STATE_TO_BE_FREED
session.c:session_free:only free the memory if session is not child session. If it is child, session is left to be freed by the parent (in tee filter's freeSession, for example).

tee.c:newSession:mark branch session to child.
tee.c:freeSession:if child session memory is ready to be freed, free it.

mysql_mon.c:monitorMain:when backend server's status changes so that it is not running anymore or doesn't have any of the states - master, slave, ndb, joined - call for each DCB the callback-function DCB_REASON_NOT_RESPONDING if specified. Earlier callbacks were called if there was any change in the state of the server being monitored.
2014-12-22 16:24:07 +02:00
Markus Makela
68932b49f2 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-20 16:16:05 +02:00
Markus Makela
63006f686d Fixed rwsplit hint tests writing to source tree instead of the build tree. 2014-12-20 16:15:13 +02:00
Mark Riddoch
3e37f0d0f6 Fixed race condition on hashtable n_readers field 2014-12-19 15:54:05 +00:00
VilhoRaatikka
c33e17db31 Fix to NULL reference 2014-12-19 14:05:56 +02:00
VilhoRaatikka
726f221113 Added debug log to session closing and related functions 2014-12-19 12:18:25 +02:00
VilhoRaatikka
55447919ce Fix to Coverity issue 84943 2014-12-19 11:35:17 +02:00
VilhoRaatikka
552d3186eb Disabled fix to #642 for now. 2014-12-18 19:20:21 +02:00
VilhoRaatikka
0b9bec3d7e Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-18 19:17:14 +02:00
VilhoRaatikka
ac97fcd764 Removed redundancy from error and message logs.
server.c: Added new member to SERVER->master_err_is_logged. It is used if server loses master status. It causes error log print in readwritesplit router's eror handling. Initial value is false and it is set always to false when server's status is set to master.
Added message log printing to mysql monitor, if master status changes to something else. It is not warning or error but only information which probably interests the user.

readwritesplit.c:Muted warnings and error printings in cases if slaves are not found if it is allowed to have a master only.
readwritesplit.c:Corrected error log printing in case where master lost its status. REdundant prints are removed.
2014-12-18 19:12:01 +02:00
Markus Makela
4d21e901ef Package building now requires CMake version 2.8.12 or greater. 2014-12-18 15:27:37 +02:00
Markus Makela
58f25fdf9b Revert "Disabled NDBMoniton for GA."
This reverts commit a55e40bd589226ef5ad5a866b7529ae5841053f7.
2014-12-18 13:43:16 +02:00
Markus Makela
a55e40bd58 Disabled NDBMoniton for GA. 2014-12-18 13:20:35 +02:00
VilhoRaatikka
494ac968e2 Fix candidate to bug #642, http://bugs.skysql.com/show_bug.cgi?id=652
If user only has a privileges to certain table, login with db still succeeds.

Removed invalid debug assertion from readwritesplit.c
2014-12-17 23:51:04 +02:00
Mark Riddoch
a655e394ac Merge branch 'blr' into release-1.0GA
Conflicts:
	server/core/service.c
2014-12-16 15:44:19 +00:00
Mark Riddoch
203e83d508 Update to COM_STATISTICS to show master connection state 2014-12-16 15:35:39 +00:00
Mark Riddoch
5ef7ddfe1f Bug 653 - Memory overwrite 2014-12-16 15:34:06 +00:00
Mark Riddoch
909518fac7 Improved error messages
Support for running out of disk space in the binlog router

Support for COM_PING & COM_STATISTICS added in the binlog router

Addition of binlogdir router option
2014-12-16 10:38:09 +00: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
82407ceaf4 Fix to #650, http://bugs.mariadb.com/show_bug.cgi?id=650
Added checks.
2014-12-15 15:03:47 +02:00
VilhoRaatikka
6f6df39e62 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-15 11:41:12 +02:00
VilhoRaatikka
4dd6f1b9c0 Added comment to assertion regarding to bref->bref_pending_cmd which is a one-slot buffer for database query. If sessoin command cursor is active when query is routed, instead of routing the query to backend it is stored to bref_pending_cmd to wait until previous (session) command is completed. The assertion traps if there is a command already in the bref_pending_cmd.
Situation is wrong because client shouldn't send new query before the previous (the pending one) is executed in backend and the reply is sent to the client.
2014-12-15 11:35:07 +02:00
Markus Makela
04a92e40df Fixes to Coverity defects 84879 84878 72752 72742 2014-12-15 06:28:47 +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
VilhoRaatikka
c31f971999 Fix candidate for #645, http://bugs.skysql.com/show_bug.cgi?id=645 and #648, http://bugs.skysql.com/show_bug.cgi?id=648
If readwritesplit.c:routeQuery gets a GWBUF whose type is UNDEFINED, then each MySQL packet is extracted from input buffer and passed to new function, route_single_stmt. Each extracted packet is stored in separate GWBUF and added types GWBUF_TYPE_MYSQL and GWBUG_TYPE_SINGLE_STMT which makes it possible to execute session commands and process reply packets properly.

Code nedes still cleaning but this is for testing atm.
2014-12-13 01:55:40 +02:00
VilhoRaatikka
339f604d73 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-12 21:18:13 +02:00
Markus Makela
4c9307bbf2 Updated MaxScale_test.cnf 2014-12-12 17:15:11 +02:00
VilhoRaatikka
e55c70b329 Session status wasn't updated in tee filter's closeSession 2014-12-12 14:36:05 +02:00
Timofey Turenko
d607d3ec7c change capital -RC to lowcase -rc in the package name 2014-12-12 13:07:51 +02:00
Mark Riddoch
1fc063b437 Added pepared statements and field lsit support to the command types
to duplciate
2014-12-12 10:02:24 +00:00
Mark Riddoch
c266a2cf57 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-12 09:46:26 +00:00
Mark Riddoch
680f7ef2c1 Add fix for duplicating COM_QUIT, COM_INIT_DB and COM_CHANGE_USER packets 2014-12-12 09:45:52 +00:00
Timofey Turenko
89c9bb8ade change version from 'beta' to 'RC' 2014-12-11 22:22:52 +02:00
Mark Riddoch
3ffa585fe4 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-11 13:49:01 +00:00
Mark Riddoch
573cf6040c Check for the duplciate service being the same as the service that is using the
tee filter. I.e. trap simple recursive definitions.
2014-12-11 13:45:21 +00:00
VilhoRaatikka
63def8d002 Fix to bug #644, http://bugs.mariadb.com/show_bug.cgi?id=644
Initialized the lock variable in gwbuf_clone
2014-12-11 15:28:41 +02:00
Markus Makela
c75ba90f6f Fixes to Coverity defect 84478 and to 72759 which has reappeared. 2014-12-11 09:43:59 +02:00