Disable tee tests for 2.0

The tee filter does not work correctly in 2.0.
This commit is contained in:
Markus Mäkelä
2017-05-30 09:09:25 +03:00
parent 480b3554c6
commit e786d62215
3 changed files with 14 additions and 45 deletions

View File

@ -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 <iostream>
#include "testconnections.h"
#include "sql_t1.h"