754 Commits

Author SHA1 Message Date
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
Mark Riddoch
3e37f0d0f6 Fixed race condition on hashtable n_readers field 2014-12-19 15:54:05 +00:00
VilhoRaatikka
726f221113 Added debug log to session closing and related functions 2014-12-19 12:18:25 +02:00
VilhoRaatikka
552d3186eb Disabled fix to #642 for now. 2014-12-18 19:20:21 +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
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
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
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
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
Markus Makela
89ccc7c927 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-10 18:06:48 +02:00
Markus Makela
2a623c6ec3 Fixed a typo in config.c 2014-12-10 18:05:58 +02:00
VilhoRaatikka
0967a09b5c Added severity keyword to error log messages 2014-12-09 14:26:33 +02:00
Mark Riddoch
26e3486966 Fix for router instance creation failure 2014-12-09 09:54:04 +00:00
Markus Makela
8b51d4fee2 Fix to bug 640: http://bugs.mariadb.com/show_bug.cgi?id=640
Added a check for the case when createInstance returns NULL.
Added messages to error log if router instance creation fails or if the service fails to start for any reason.
2014-12-09 06:31:53 +02:00
VilhoRaatikka
5264a1abc9 Added function documentation, moved one non-error log entry to message log, cleaned up a bit. 2014-12-08 16:02:16 +02:00
Mark Riddoch
825320dd7a Merge branch 'release-1.0GA' into develop 2014-12-08 10:24:19 +00:00
Mark Riddoch
e102d56e69 Merge branch 'blr' into release-1.0GA
Conflicts:
	server/modules/protocol/mysql_backend.c
	server/modules/routing/binlog/blr_master.c
2014-12-05 11:42:02 +00:00
Mark Riddoch
2b998eb17f Merging binlog router into beta refresh 2014-12-05 11:30:03 +00:00
Mark Riddoch
de3b2db904 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-05 09:06:05 +00:00
MassimilianoPinto
2d4073267c Added support for a.%, a.%.% and a.b.%
Added support for a.%, a.%.% and a.b.% in dbusers.c
2014-12-04 19:01:17 +01:00
Mark Riddoch
4db86a5520 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-04 16:57:57 +00:00
Mark Riddoch
36aea7454f Updates for new logging definitions 2014-12-04 16:56:33 +00:00
Markus Makela
84679a48ff Fixes to Coverity defects 84335 84336 84337 2014-12-04 10:13:41 +02:00
Markus Makela
30c928c326 Switched to /dev/random instead of time(NULL) in secrets.c 2014-12-04 10:07:06 +02:00
Markus Makela
1e2027f4dc Fixes to Coverity defects 83027 73421 72714 72671 72646 72642 2014-12-03 17:56:22 +02:00
Mark Riddoch
fdb9c5e6dc Switch to thread safe versions of localtime and asctime 2014-12-03 09:53:17 +00:00
Mark Riddoch
1e5bc37780 Use strtok_r rather than strtok 2014-12-03 09:33:55 +00:00
Markus Makela
49534f75b5 Added synchronous log flushing to disk when a signal is received. 2014-12-02 13:31:15 +02:00
VilhoRaatikka
83f7203213 Fix to unreported bug which printed result of getsockopt even in case when there was no socket error. 2014-11-27 15:37:13 +02:00
Mark Riddoch
d063df0f4a Update message 2014-11-26 11:10:59 +00:00
Mark Riddoch
31f5017d6d Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-11-26 11:04:48 +00:00
Mark Riddoch
6ee9a84cef Updated error messages 2014-11-26 11:04:33 +00:00
MassimilianoPinto
398eee8ece Added a log message for mysql_old_password
Added a log message for mysql_old_password detection: user is not loaded
2014-11-26 11:44:38 +01:00
Mark Riddoch
863a30c969 Merge branch 'blr' of https://github.com/mariadb-corporation/MaxScale into blr
Conflicts:
	server/core/gateway.c
2014-11-26 08:47:50 +00:00
Markus Makela
c38773407c Switched to /dev/random instead of time(NULL) in secrets.c 2014-11-25 11:37:21 +02:00
Mark Riddoch
ba44605cb0 Changes for FDE events 2014-11-21 15:01:38 +00:00
Mark Riddoch
5fa87776b0 Fixes for Coverity bugs 2014-11-20 16:04:22 +00:00
MassimilianoPinto
69a1c5aaf5 Changed log messages for dousers
Changed log messages for dousers
2014-11-20 11:31:54 +01:00
Markus Makela
a65b9fa8b3 Fixes to Coverity defects: 72662 82143 82144 82145 82348 82349 2014-11-20 06:44:43 +02:00
Mark Riddoch
43ed77b52b Bug 515 Conditional arguemnt to gw_write 2014-11-19 16:43:21 +00:00
Mark Riddoch
0e6fa09d7e Fixes for Coverity issues 2014-11-19 16:01:38 +00:00
Mark Riddoch
97b730c2e0 Addition of signal handler for SIGUSR1 to rotate all log files 2014-11-19 15:16:48 +00:00