4320 Commits

Author SHA1 Message Date
VilhoRaatikka
65c42b93cf If backend fails and sets session state to SESSION_STATE_STOPPING before session is in state SESSION_STATE_ROUTER_READY, sessoin.c:session_alloc overwrites the session state by SESSION_STATE_ROUTER_READY. Protected session state modification and added check before changing the state.
cloesSession was called in session.c:session_free if all DCBs had been removed their references to session. closeSession, however, is function which handles closing router. Router is responsible for closing all backend DCBs (=connections). Thus, calling sessionClose after all backend connections had been removed already is unnecessary and causes assertion traps.

Simply removed the call.
2014-06-24 21:59:42 +03:00
VilhoRaatikka
c30e270768 Removed dcb->command from DCB structure as it was used for session commands but not anymore.
Corrected debug assertion in dcb_final_free because DCB can be freed also when DCB is being created, that is, state is DCB_STATE_ALLOC.
2014-06-24 21:56:15 +03:00
VilhoRaatikka
442ac7fefb Added GWBUF type GWBUF_TYPE_SINGLE_STMT to indicate that buffer only includes single complete stmt. Added macro for checking the flag and changed existing routines as necessary. 2014-06-24 21:51:54 +03:00
Mark Riddoch
a652e875b5 Support for multipacket statements
Remove double free in cloned DCB's
2014-06-24 17:59:29 +01:00
MassimilianoPinto
dfe3092dc5 Merge branch 'develop' into MAX-59 2014-06-24 18:21:09 +02:00
Mark Riddoch
6bfa8897cd Fix compiler warning 2014-06-24 11:51:25 +01:00
MassimilianoPinto
d42469c6cc Merge branch 'develop' into MAX-59 2014-06-23 12:42:32 +02:00
Mark Riddoch
e650930487 Cleanup up branch session on close. 2014-06-23 10:10:04 +01:00
MassimilianoPinto
7ba64875ad master_id, depth, slaves default values
master_id, depth, slaves default values
2014-06-23 09:51:50 +02:00
Mark Riddoch
7067e43b44 Core changes to support tee filter. 2014-06-20 17:49:40 +01:00
Mark Riddoch
c759767a91 Use new session entry points to get remote and user rather than dereference
the DCB directly.
2014-06-19 16:07:21 +01:00
Mark Riddoch
4d257897d3 Merge branch 'develop' of github.com:skysql/MaxScale into develop
Conflicts:
	server/core/session.c
	server/modules/protocol/mysql_backend.c
	server/modules/routing/readwritesplit/readwritesplit.c

Resolved.

Addition of user in topfilter report and general tidyup
2014-06-18 17:45:57 +01:00
MassimilianoPinto
1b6a5efb64 merge from develop
merge from develop
2014-06-18 11:51:47 +02:00
MassimilianoPinto
38fd7b0844 master_id set by monitor
master_id set by monitor and printed via dprint* routines
2014-06-17 16:10:11 +02:00
VilhoRaatikka
e7fa80a591 Code clean up 2014-06-17 16:15:19 +03:00
VilhoRaatikka
49163a4c43 Merge branch 'develop' into MAX-11 2014-06-16 19:53:19 +03:00
VilhoRaatikka
4f03c775e5 sescmd_cursor_reset didn't reset cursor's property pointer which made reset ineffective. 2014-06-16 13:40:45 +03:00
Mark Riddoch
189793f992 Clean up some compiler warnings 2014-06-16 08:40:04 +01:00
Mark Riddoch
9f6a1061c6 Config fix 2014-06-16 08:10:34 +01:00
Mark Riddoch
850603171b Improvements to CLI commands and client 2014-06-16 07:57:12 +01:00
VilhoRaatikka
5bcae64538 When protocol closes DCB it calls dcb_close instead of dcb->func.close. dcb_close then calls dcb->func.close. This is now changed to all protocols and routers.
Rwsplit handles ERRACT_NEW_CONNECTION by clearing backend reference, removing callbacks and associating backend reference with new backend server. If it succeeds and the router session can continue, handleError returns true. Otherwise false. When ever false is returned it means that session must be closed.

Rwsplit now tolerates backend failures in a way that it searches new backends when monitor, backend, or client operation fails due to backend failure.
2014-06-15 23:44:07 +03:00
Mark Riddoch
8103ac6052 Merge branch 'develop' into MAX-65 2014-06-14 12:54:08 +01:00
Mark Riddoch
719503e471 Addition of new client utility, maxadmin.
Supporting protocol for the admin interface

New routing module, cli, which shares source with debugcli

Tidyup output of lsit commands
2014-06-13 23:40:07 +01:00
VilhoRaatikka
09d20d1059 Modified dcb_call_foreach so that it doesn't hold spinlock (dcbspin) continuously because it caused deadlock when new slaves were tried to connect with.
Fixed a few smallish things.
2014-06-13 14:52:04 +03:00
VilhoRaatikka
dfc9141a38 Whenever monitored server's state changes, a callback, router_handle_state_switch is called for each DCB in MaxScale session. The DCB referring to the server in question will be passed as parameter to backend DCB's hangup function.
The logic that solves the situation is not in place yet.
2014-06-13 13:30:50 +03:00
VilhoRaatikka
9eda859724 Added callback for rwsplit router which traverses through every rwsplit router session and for each rses, all backend references. Each bref is checked whether it is connected to non responsive server and if it is flagged to be waiting for response from the non-responsive backend. For matching ones, backend protocol's hangup function is called. 2014-06-13 08:01:26 +03:00
VilhoRaatikka
15ff1fd26a Fixed many error handling issues regading to timing and multiple threads.
Added flags to those backend references which have sent something to backend which causes the backend to send results or reply back. Didn't add removal of the flag since there's currently no way to tell whether response from backend contains anything else than session command reply - which aren't counted when BREF_WAITING_RESULT is set and cleared.
2014-06-12 23:22:51 +03:00
VilhoRaatikka
e95b6cc0d9 dcb.c, gw_utils.c, mysql_server_protocol.h, mysql_client.c : Replaced gw_read_gwbuff with dcb_read in mysql_client.c:gw_read_client_event.
rwsplit.sh, test_sescmd.sql : Added test case for session commands.
2014-06-12 19:02:47 +03:00
Mark Riddoch
d17315b2cd Updated QLA filter to allow for regex matches and client address matches
to control the statements that are logged.
2014-06-11 23:55:29 +01:00
Mark Riddoch
2963a8448b Implement non-blocking alternative to mutexes for read serialisation 2014-06-10 17:59:49 +01:00
Mark Riddoch
a8def0d670 Additional error checking and documentation.
Implementation of topfilter options
2014-06-10 11:57:48 +01:00
Mark Riddoch
77e1426dbf Initial upstream fitlering implementation.
Test filter with up and down stream filtering. Keeps top N queries
and prints a report of these queries on session close.
2014-06-09 21:13:28 +01:00
VilhoRaatikka
889bdd4f8c In dcb.c:dcb_close DCB is removed either before or after the call dcb->func.close. Since mysql backend protocol sends COM_QUIT and thus, writes to backend DCB, it is kept in DCB_STATE_POLLING until the write is completed.
dcb.h: define ERRHAND temporarily since changes are still behind that macro
Defined two error handling actions in router.h: ERRACT_NEW_COMMECTION and ERRACT_REPLY_CLIENT.
Failed database is logged at expanding frequence to error and to message log due changes in mysql_mon.c. Added two new members in MONITOR_SERVERS: mon_err_count, and mon_prev_status so that each backend can be treated individually.

Error handling: if mysql_backend.c:dcb_read fails, router's handleError is called instead of closing session.
	If mysql_client.c:SESSION_ROUTE_QUERY fails router's handleError is called instead of sending error to client.

	readwritesplit.c:select_connect_backend_servers is modified so that in can be called during active router session. When called, it attempts to find one master and maximum number of configured slaves in correct state if necessary.
	When handleError needs to replace failed unit it now calls select_connect_backend_servers.
2014-06-08 19:36:12 +03:00
Mark Riddoch
fda9b1c706 Merge branch 'develop' into blr
Conflicts:
	server/core/dcb.c
	server/modules/include/blr.h
	server/modules/routing/binlog/STATUS
	server/modules/routing/binlog/blr.c
	server/modules/routing/binlog/blr_file.c
	server/modules/routing/binlog/blr_master.c
	server/modules/routing/binlog/blr_slave.c
2014-06-08 00:50:36 +01:00
Mark Riddoch
13e95ffc53 Improved diagnostics
Added master reconnect on failure

Added EPOLLRDHUP events
2014-06-07 21:01:11 +01:00
Mark Riddoch
9e164b83f0 Updates to debug CLI
Fix for argument passign to show filter

Addition of list dcbs commands
2014-06-07 20:41:58 +01:00
VilhoRaatikka
ad744962b2 Merge branch 'develop' into MAX-11
Conflicts:
	server/include/server.h
	server/modules/monitor/mysql_mon.c
	server/modules/protocol/mysql_client.c
	server/modules/routing/readwritesplit/readwritesplit.c
	utils/skygw_debug.h
2014-06-07 00:50:08 +03:00
VilhoRaatikka
7e6cb7afc2 Snapshot of failure tolerance changes.
Added a lot of logging to error, trace and message logs which should help the user to handle errors which can't be automatically resolved, like attempt to use nonexisting database.
2014-06-06 23:32:04 +03:00
VilhoRaatikka
047dd5f90e process_config_update didn't handle filter type which caused erroneous message being printed to error log. 2014-06-05 21:09:23 +03:00
VilhoRaatikka
1a43a4868f Added check for NULL pointer in serviceClearRouterOptions. 2014-06-05 20:17:39 +03:00
Mark Riddoch
c1c188cf4f Fix for unintialised structure member 2014-06-05 16:24:05 +01:00
Mark Riddoch
be87556ab0 Fix for compiler warnings 2014-06-05 15:26:57 +01:00
Mark Riddoch
959b9aeec8 Merge branch 'develop' of github.com:skysql/MaxScale into develop 2014-06-05 15:09:16 +01:00
Mark Riddoch
01af5d1aef Fix for config file ordering 2014-06-05 15:08:49 +01:00
Mark Riddoch
9904e71efe Fixed issue with filter object poitner not being initialised.
Addition of "not loaded" message in show filters
2014-06-05 08:55:19 +01:00
Mark Riddoch
46ca0676c0 A filter parameter fix and a new filter, the regex filter.
The regexfilter is an example of a query rewriting filter that uses
regular expressions to match the SQL text and allows a replacement text
to be used for each match of the regular expression.

Regexfilter has no special SQL undertanding, it merely uses the features
avialable inthe regex library to perform matches.

Statements that span multiple packets are not supported by the regex
filter.
2014-06-04 23:04:17 +01:00
Mark Riddoch
f612b90cd7 Merge branch 'develop' into MAX-65 2014-06-04 21:14:31 +01:00
Mark Riddoch
bb0e6c3858 Support non-default binlog filenames
Add support for bin log file names that are shorter than the default.
Handle events per more than 2 packets
2014-06-04 18:37:41 +01:00
Mark Riddoch
57e910ad3d Addition of the module utilities functions 2014-06-04 18:34:24 +01:00
Mark Riddoch
1ebf27eab3 Add server maintenance mode.
Maintenance mode prevents a server from having new connections made
to it and stops MaxScale from monitoring a server. It is designed
to allow a server to be taken out of an active cluster for maintenance.
It prevents new connections and allowsg existing connections to
drain away prior to performaing maintenance on the server.
2014-06-03 09:25:09 +01:00