diff --git a/maxscale-system-test/CMakeLists.txt b/maxscale-system-test/CMakeLists.txt index ea935739e..adc28568d 100644 --- a/maxscale-system-test/CMakeLists.txt +++ b/maxscale-system-test/CMakeLists.txt @@ -121,7 +121,7 @@ add_test_executable(bug547.cpp bug547 replication LABELS readwritesplit REPL_BAC add_test_executable(bug681.cpp bug681 galera.bug681 LABELS readwritesplit GALERA_BACKEND) # Regression case for the bug "crash with tee filter" -add_test_executable(bug643.cpp bug643 bug643 LABELS tee REPL_BACKEND) +#add_test_executable(bug643.cpp bug643 bug643 LABELS tee REPL_BACKEND) # Regression case for the bug ""Different error messages from MariaDB and Maxscale" add_test_script(bug561.sh bug561.sh replication LABELS MySQLAuth REPL_BACKEND) @@ -166,13 +166,13 @@ add_test_executable(bug626.cpp bug626 replication LABELS MySQLAuth MySQLProtocol add_test_executable(bug634.cpp bug634 replication LABELS readwritesplit REPL_BACKEND) # Regression cases for several TEE filter hangs -add_test_executable(bug645.cpp bug645 bug645 LABELS tee REPL_BACKEND) -add_test_executable(bug645_1.cpp bug645_1 bug645_1 LABELS tee REPL_BACKEND) -add_test_executable(bug649.cpp bug649 bug645 LABELS tee) -add_test_executable(bug650.cpp bug650 bug650 LABELS tee REPL_BACKEND) +#add_test_executable(bug645.cpp bug645 bug645 LABELS tee REPL_BACKEND) +#add_test_executable(bug645_1.cpp bug645_1 bug645_1 LABELS tee REPL_BACKEND) +#add_test_executable(bug649.cpp bug649 bug645 LABELS tee) +#add_test_executable(bug650.cpp bug650 bug650 LABELS tee REPL_BACKEND) # Heavy test for TEE filter -add_test_script(bug648 sql_queries bug648 LABELS tee UNSTABLE HEAVY REPL_BACKEND) +#add_test_script(bug648 sql_queries bug648 LABELS tee UNSTABLE HEAVY REPL_BACKEND) # Crash when host name for some user in mysql.user is very long add_test_executable(bug653.cpp bug653 replication LABELS MySQLAuth MySQLProtocol REPL_BACKEND) @@ -181,7 +181,7 @@ add_test_executable(bug653.cpp bug653 replication LABELS MySQLAuth MySQLProtocol add_test_executable(bug654.cpp bug654 replication LABELS maxscale REPL_BACKEND) # Regression case for the bug "Tee filter: closing child session causes MaxScale to fail" -add_test_executable(bug657.cpp bug657 bug657 LABELS tee REPL_BACKEND) +#add_test_executable(bug657.cpp bug657 bug657 LABELS tee REPL_BACKEND) # Block backends (master or all slaves) and tries to connect Maxscale add_test_executable(bug658.cpp bug658 replication LABELS readwritesplit readconnroute maxscale REPL_BACKEND) @@ -193,7 +193,7 @@ add_test_executable(bug662.cpp bug662 replication LABELS readwritesplit readconn add_test_executable(bug664.cpp bug664 bug664 LABELS MySQLAuth MySQLProtocol) # TEE fileter: execute long sequence of queries ans session commands in the loop -add_test_executable(bug670.cpp bug670 bug670 LABELS tee REPL_BACKEND) +#add_test_executable(bug670.cpp bug670 bug670 LABELS tee REPL_BACKEND) # Regression case for the bug "MaxScale crashes if "Users table data" is empty and "show dbusers" is executed in maxadmin" add_test_executable(bug673.cpp bug673 bug673 LABELS MySQLAuth REPL_BACKEND) @@ -366,7 +366,7 @@ add_test_executable(mxs431.cpp mxs431 sharding LABELS schemarouter REPL_BACKEND add_test_executable(mxs47.cpp mxs47 replication LABELS MySQLProtocol LIGHT REPL_BACKEND) # Regression case for the bug "USE hangs when Tee filter uses matching" -add_test_executable(mxs501_tee_usedb.cpp mxs501_tee_usedb mxs501 LABELS tee REPL_BACKEND) +#add_test_executable(mxs501_tee_usedb.cpp mxs501_tee_usedb mxs501 LABELS tee REPL_BACKEND) # Open connection, execute 'change user', close connection in the loop add_test_executable(mxs548_short_session_change_user.cpp mxs548_short_session_change_user mxs548 LABELS MySQLProtocol REPL_BACKEND) diff --git a/maxscale-system-test/bug649.cpp b/maxscale-system-test/bug649.cpp index bfd9bca3f..a414a6ea7 100644 --- a/maxscale-system-test/bug649.cpp +++ b/maxscale-system-test/bug649.cpp @@ -124,6 +124,11 @@ int main(int argc, char *argv[]) Test->try_query(Test->conn_rwsplit, (char *) "show processlist;"); Test->close_rwsplit(); + /** Clean up */ + Test->repl->connect(); + execute_query(Test->repl->nodes[0], "DROP DATABASE test"); + execute_query(Test->repl->nodes[0], "CREATE DATABASE test"); + int rval = Test->global_result; delete Test; return rval; diff --git a/maxscale-system-test/bug657.cpp b/maxscale-system-test/bug657.cpp index e6c9ec72f..cf41028ad 100644 --- a/maxscale-system-test/bug657.cpp +++ b/maxscale-system-test/bug657.cpp @@ -40,42 +40,6 @@ service=RW Split Router * - Reconnect readconnrouter */ -/* -Vilho Raatikka 2014-12-22 08:35:52 UTC -How to reproduce: -1. Configure readconnrouter with tee filter and tee filter with a readwritesplit as a child service. -2. Start MaxScale -3. Connect readconnrouter -4. Fail the master node -5. Reconnect readconnrouter - -As a consequence, next routeQuery will be duplicated to closed readwritesplit router and eventually fred memory will be accessed which causes SEGFAULT. - -Reason for this is that situation where child (=branch -) session is closed as a consequence of node failure, is not handled in tee filter. Tee filter handles the case where client closes the session. -Comment 1 Vilho Raatikka 2014-12-22 09:14:13 UTC -Background: client session may be closed for different reasons. If client actively closes it by sending COM_QUIT packet, it happens from top to bottom: packet is identified and client DCB is closed. Client's DCB close routine also closes the client router session. - -If backend fails and monitor detects it, then every DCB that isn't running or isn't master, slave, joined (Galera) nor ndb calls its hangup function. If the failed node was master then client session gets state SESSION_STATE_STOPPING which triggers first closing the client DCB and as a part of it, the whole session. - -In tee filter, the first issue is the client DCB's close routine which doesn't trigger closing the session. The other issue is that if child session gets closed there's no mechanism that would prevent future queries being routed to tee's child service. As a consequence, future calls to routeQuery will access closed child session including freed memory etc. -Comment 2 Vilho Raatikka 2014-12-22 22:32:25 UTC -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. -Comment 3 Vilho Raatikka 2014-12-23 10:04:11 UTC -If monitor haven't yet changed the status for failed backend, even the fixed won't notice the failure, and the client is left waiting for reply until some lower level timeout exceeds and closes the socket. - -The solution is to register a callback function to readconnrouter's backend DCB in the same way that it is done in readwritesplit. Callback needs to be implemented and tests added. -By using this mechanism the client must wait at most one monitor interval before the session is closed. - -Vilho Raatikka 2014-12-31 23:19:41 UTC -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 -*/ - - #include #include "testconnections.h" #include "sql_t1.h"