1501 Commits

Author SHA1 Message Date
Markus Makela
fed828eb29 Merge branch 'release-1.0GA' into MAX-324
Conflicts:
	server/MaxScale_template.cnf
	server/core/service.c
2015-01-06 04:45:30 +02:00
Markus Makela
cd99849581 Fix #2 to bug 680: http://bugs.mariadb.com/show_bug.cgi?id=680"
When no users are loaded from backends, instead of counting it as a failure the service is started and the next time a client connects an attempt to load the users from the backends is made.
2015-01-05 17:38:45 +02:00
Markus Makela
91a3109f4d Fix to bug 638: http://bugs.mariadb.com/show_bug.cgi?id=638
readwritesplit.c:Added missing backend type when using max_slave_replication_lag hint.
2015-01-05 14:28:16 +02:00
Markus Makela
468ce72c18 Fix to bug 681: http://bugs.mariadb.com/show_bug.cgi?id=681
Added casts to floating point versions of values when doing divisions.
2015-01-05 13:54:27 +02:00
Markus Makela
6adccb3c17 Fix to bug 680: http://bugs.mariadb.com/show_bug.cgi?id=680
service.h:Added the 'serviceStartFailed' function which tries to start services with successfully started routers but no successfully started listeners.
mysql_mon.c:Added a call to ServiceStartFailed when servers come available.
2015-01-05 13:38:39 +02:00
Markus Makela
185e5b82d6 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2015-01-05 06:09:39 +02:00
Markus Makela
ba009e5fd3 Fixes to Coverity defects 85010 84878 72752 72742 72719 and 73418.
skygw_utils.cc: Added function is_valid_posix_path that checks if a path is POSIX-compliant.
2015-01-05 06:05:56 +02:00
VilhoRaatikka
2d3491e123 Additional fix to bug #676
readwritesplit.c:route_session_write: added check that at least one backend is being used.
2015-01-03 01:47:11 +02:00
VilhoRaatikka
9be2212d96 Fix to bug #676, http://bugs.mariadb.com/show_bug.cgi?id=676
readwritesplit.c:route_session_write failed if the last backend on all backends list was not in use. THe situation where not all backends are used by routing session is normal especially if max_slave_connections is not set to 100%. Thus session commands may have failed if user was bit unlucky.
Changed the logic so that the function fails (and session is closed) if routing fails to any such backend which is in use in the session.
2015-01-03 01:21:30 +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
a3d5367d55 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA
Conflicts:
	server/modules/filter/tee.c
2015-01-02 18:43:17 +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
Markus Makela
ef19b9e729 Fixed concurrency issues in tee.
tee.c: added a spinlock to the session which is used in clientReply
2015-01-02 16:21:21 +02:00
Markus Makela
ed961b5d1b Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2015-01-02 16:13:15 +02:00
Markus Makela
a99c24e9dc Tee filter now only returns the reply from the parent service. 2015-01-02 16:12:44 +02:00
VilhoRaatikka
48f443782e Fixed a typo 2015-01-02 09:55:55 +02:00
VilhoRaatikka
38b16ec2d0 Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2015-01-02 09:54:29 +02:00
VilhoRaatikka
a745383956 Added debug log to mysql_backend.c:gw_read_backend_event to tracm the case where less than 5 bytes is read from backend. This is potential issue with long result sets. 2015-01-02 09:53:24 +02:00
Markus Makela
4e655eda0a Fixes to coverity defects 85250 and 85251. 2015-01-02 07:21:13 +02:00
Markus Makela
89a394ab09 Fixed orphaned sessions being stuck in the SESSION_STATE_STOPPING state. 2015-01-01 19:53:26 +02:00
Markus Makela
9061967c31 Added simple query success detection to tee filter.
tee.c: If one query fails and the other succeeds the successful one is returned to the client.
2015-01-01 14:14:36 +02:00
Markus Makela
ce58157901 Added more debugging output.
tee.c: Added details about the freeing of orphaned sessions.
session.: Added missing cases of session state into the session_state function in debug builds.
2015-01-01 13:03:03 +02:00
Markus Makela
162391c46c Fixed orphaned branch sessions leaking memory.
tee.c: Created a static, module-wide list of orphaned branch sessions which holds the branch sessions that can't be freed at the
time the parent session is being freed. This list is processed every time a a tee filter session is freeing its memory.
2015-01-01 07:37:28 +02:00
VilhoRaatikka
2eee4ae4fd Fix to Bug #657, http://bugs.skysql.com/show_bug.cgi?id=657
filter.c:filter_free:if filter parameter is NULL, return.
tee.c:freeSession: if my_session->dummy_filterdef is NULL, don't try to release the memory
2015-01-01 01:20:21 +02:00
VilhoRaatikka
f4f537a3e2 Fix to bug #673, http://bugs.skysql.com/show_bug.cgi?id=673
dcb.c:dcb_hashtable_stats:division by zero
hashtable.c:hashtable_get_stats: NULL-pointer reference
service.c:serviceStartPort:set service->users NULL to avoid referring to freed memory
users.c:dcb_usersPrintf: NULL-pointer reference
debugcmd.c:convert_arg: changed return value to 1 in case of error, 0 (==NULL) is valid but it indicates that there are no users loaded.
	execute_cmd: fixed command handling
2014-12-31 21:06:28 +02:00
Markus Makela
9b52f5e6ba Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-31 16:28:05 +02:00
VilhoRaatikka
51ebfb9862 Fix to Coverity issue 85210. 2014-12-31 16:29:07 +02:00
Markus Makela
6710d5d25e Fixed a call to free with a pointer to a stack allocated struct. 2014-12-31 16:26:42 +02:00
Markus Makela
316093f912 Fixed memory leaks and cleaned up dead code. 2014-12-31 15:38:15 +02:00
VilhoRaatikka
d1bc68c7d0 Added new member to TEE_SESSION structure: TEE_SESSION->tee_replybuf where reply message is stored until replied to client.
Temporarily commented out waiting section and left to be removed after further testing.
2014-12-31 14:42:14 +02:00
Markus Makela
5ab329f888 Changed the way replies are handled.
Tee filter now receives two client replies, one from the parent service and
one from the child service. These replies are checked before cloning any more queries
into the child service. If the reply isn't sent fast enough, the child session is closed.
2014-12-31 12:58:37 +02:00
Markus Makela
d3e15afb2f Moved the branch session reply state inspection to routeQuery instead of clientReply. 2014-12-31 07:19:12 +02:00
Markus Makela
073db0f1e2 Added checks that the query was cloned in clientReply before waiting for a reply. 2014-12-30 23:05:13 +02:00
Markus Makela
9a77509e6a Added logging to trace log about waiting times and branch session closing. 2014-12-30 18:30:09 +02: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
6b68136377 Fix to bugs #664 and #665
http://bugs.skysql.com/show_bug.cgi?id=664
http://bugs.skysql.com/show_bug.cgi?id=665

Cloned session was freeing the shared 'data' dcb->data/session->data. Now only session_free for the non-clone session is allowed to free the data.
2014-12-30 13:35:59 +02:00
VilhoRaatikka
77bd279a01 Fix to prevent double free of dcb->data/session->data. If authentication fails, call free(dcb->data) only when DCB in question is *not* cloned. 2014-12-30 12:28:36 +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
df0b04a5c0 Fix: accessed released memory in mysql_client.c where dcb->data was released in gw_mysql_do_authentication and accessed afterwards. 2014-12-30 10:36:06 +02:00
VilhoRaatikka
c2cdbf40bc Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-30 10:05:57 +02:00
VilhoRaatikka
2c2d6f8b66 Clean up. Removed dead code and added comments. 2014-12-30 10:05:13 +02:00
Markus Makela
89f90c53db Merge branch 'tee_recursion_fix' into release-1.0GA
Conflicts:
	server/modules/filter/test/tee_recursion.sh
2014-12-29 20:48:03 +02:00
VilhoRaatikka
2b30dcad6b Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-29 20:30:11 +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
ecdb6f2d4a Added a test for tee filter recursion. 2014-12-29 20:14:08 +02:00
Markus Makela
69237b4f4f Added tests for tee filter recursion. 2014-12-29 14:58:08 +02:00
Markus Makela
fcca284db3 Added complex recursion detection to tee filter 2014-12-24 06:22:49 +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
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