Commit Graph

160 Commits

Author SHA1 Message Date
dbf12f6183 Added new rules for Master selection
Added new rules for Master selection using replication tree
2014-06-25 18:38:33 +02:00
5a65bc2aaa get_root_master routine available
get_root_master routine available
2014-06-25 17:19:14 +02:00
2eafe15bca Added master_host update in the loop
Added master_host update in the loop, returns the right server in case
of multiple servers with same replication depth
2014-06-25 15:51:29 +02:00
52ef3b6718 New rules for selecting Master/Slaves
New rules for selecting Master/Slaves are based on MySQL depth in the
replication tree.
The only Master is the root server with SERVER_MASTER bit set
All other servers even with both SLAVE and MASTER bit will be selected
as slaves
2014-06-24 15:44:14 +02:00
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
e7fa80a591 Code clean up 2014-06-17 16:15:19 +03:00
49163a4c43 Merge branch 'develop' into MAX-11 2014-06-16 19:53:19 +03:00
4f03c775e5 sescmd_cursor_reset didn't reset cursor's property pointer which made reset ineffective. 2014-06-16 13:40:45 +03:00
0200ca4e24 Some things weren't switched off from product build. 2014-06-16 00:31:14 +03:00
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
8103ac6052 Merge branch 'develop' into MAX-65 2014-06-14 12:54:08 +01:00
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
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
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
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
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
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
02330093cc Added test for session commands. 2014-06-11 15:33:42 +03:00
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
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
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
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
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
f612b90cd7 Merge branch 'develop' into MAX-65 2014-06-04 21:14:31 +01:00
7e863657db Removed references to SERVER_IS_JOINED status from readwritesplit.c because rwsplit for Galera doesn't use that status at all. 2014-06-04 14:49:05 +03:00
46495bb59e Bug #443, http://bugs.skysql.com/show_bug.cgi?id=443
monitors used mysql_ping without MYSQL_OPT_READ_TIMEOUT which caused read to block. Fixed in mysql and galera monitor.
Added log writing per each status change of each server and repeatedly if server is not running.

Removed SERVER_IS_JOINED checks from rwsplit router.
2014-06-03 19:39:50 +03:00
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
b764745fc3 Merge branch 'develop' into MAX-65
Conflicts:
	server/core/config.c
2014-06-02 18:07:09 +01:00
1245fba35b Addition of the module info structure to allow module information to
be extracted from the modules.

This gives a way to verify the API that the module provides as well
as the version of that API. The hope is that this will make it possible
for MaxScale to detect out of date plugins and either adapt to use them
or reject loading them.

Also added the ability to set a release state on a per module basis.
This allows for production ready and non-production ready plugins to
be identified.
2014-06-02 17:10:05 +01:00
8d55be4b23 First working filters implementaton.
Only downstream filters are supported currently, i.e. no result
set filtering can be done.

A crude QLA (Query Log All) filter is included as a test harness only
2014-05-30 16:45:39 +01:00
3e17120105 Allow space for terminating NULL in args array 2014-05-29 16:57:17 +01:00
f84e2b0dae Merge branch 'develop' of github.com:skysql/MaxScale into develop 2014-05-28 23:39:17 +01:00
797f044cf9 Addition of the list command to the debugcli to list servers,
services, listeners and sessions
2014-05-28 23:25:47 +01:00
1a2b8e5475 Router spinlock wasn't used to protect routing. As a consequence router could have been closed in thread #1 while thread #2 was in a middle of execution of router code. Solved by holding router lock so that it covered whole routing operation. 2014-05-28 18:29:02 +03:00
d12ed592a0 Removed a duplicate code added by merge
A code duplication occurred in a switch statement during the merge of the cenh branch
2014-05-27 09:44:17 +01:00
c23773c977 Removed binlog path
Removed binlog path
2014-05-26 12:40:56 +02:00
378d00983d merge from branch 'cenh'
merge from branch ‘cenh’
2014-05-26 12:15:34 +02:00
7b24841af6 Updated
Upated
2014-05-26 11:57:16 +02:00
82b7b1064d Removed extra space
Removed extra space
2014-05-26 10:45:35 +02:00
698e63eaf4 Changed bash-related comparison equality operator '==' to generic '=' 2014-05-23 22:08:57 +03:00
a6eb7bd743 Added space character between '--' and comment text in sql scripts. 2014-05-23 22:07:32 +03:00
78c5c407bd Fixed conflict 2014-05-23 16:43:11 +01:00
45d5d521b8 Merge branch 'blr' into cenh
Conflicts:
	Documentation/MaxScale Configuration And Usage Scenarios.pdf
	server/core/config.c
	server/core/dcb.c
	server/core/service.c
	server/modules/routing/Makefile
	server/modules/routing/debugcmd.c
	server/modules/routing/readwritesplit/readwritesplit.c
	server/modules/routing/readwritesplit/test/rwsplit.sh
2014-05-23 16:39:39 +01:00
7fe50a311f Addition of developer and user modes to debugcli
In order to be able to protect the interface so that mistyped argument
do not endanger MaxScale yet still allow the developer access a router
option has been added that gives the debugcli two modes.
2014-05-23 13:29:58 +01:00
23a9759fca Fixed a couple of memory leaks 2014-05-23 09:08:02 +01:00
3b984d2773 Improve quoting mechanism is debug interface
Introduce the use of \ and allow the quotes to appear at any point
within the string, not just the beginning and end of words.
2014-05-22 15:24:07 +01:00
837d15dc33 Fix valgrind issue with saved master responses 2014-05-22 15:07:46 +01:00
23956d737b Changed bash-related comparison equality operator '==' to generic '=' 2014-05-21 22:10:40 +03:00
77299fea2e Added space character between '--' and comment text in sql scripts. 2014-05-21 22:05:13 +03:00
c1d39999ff Improvements to debug interface & blr updates 2014-05-21 17:25:21 +01:00