144 Commits

Author SHA1 Message Date
MassimilianoPinto
96b6454e13 fix compile warnings
fix compile warnings
2014-06-27 14:11:57 +02:00
MassimilianoPinto
fdcdc064b1 Added server pending states in monitor
server pending states are now saved and copied to server status before
monitor thread sleep
2014-06-27 13:38:35 +02:00
VilhoRaatikka
20637ee224 Removed unnecessary SERVER pointer from dcb.c:dcb_call_foreach(), changed declaration and call accordingly. 2014-06-27 10:54:11 +03:00
MassimilianoPinto
f246219beb Fix compile errors and warnings
Fix compile errors and warnings
2014-06-26 18:20:33 +02:00
MassimilianoPinto
8808fd7e47 Some debug messages removed
Some debug messages removed
2014-06-26 17:18:53 +02:00
MassimilianoPinto
4d2e43a2d9 code cleanup and documentation
code cleanup and documentation
2014-06-26 16:56:21 +02:00
MassimilianoPinto
d8ac0467de Added comments for SHOW SLAVE STATUS
Added comments for SHOW SLAVE STATUS
2014-06-26 14:14:37 +02:00
MassimilianoPinto
c14700fcff Added documentation to new routines
Added documentation to new routines
2014-06-25 10:21:30 +02:00
MassimilianoPinto
e1e172fe03 Fixed compile errors
Fixed compile errors
2014-06-24 18:37:17 +02:00
MassimilianoPinto
584d8867bc Replication tree is now a routine
Replication tree is now a routine
2014-06-24 11:18:59 +02:00
MassimilianoPinto
d36100a99f Replication consistency with replication tree
Added replication consistency after replication tree computation
2014-06-23 13:12:26 +02:00
MassimilianoPinto
51d47accf7 Added replication consistency routines
Added replication consistency routines
2014-06-23 12:56:01 +02:00
MassimilianoPinto
2a1688bb3d get level 0 for the first master
get level 0 for the first master
2014-06-18 18:57:09 +02:00
MassimilianoPinto
1b6a5efb64 merge from develop
merge from develop
2014-06-18 11:51:47 +02:00
MassimilianoPinto
b2d7d28b10 fix for slave set with mariadb 10 replication
fix for slave set with mariadb 10 replication
2014-06-18 11:46:29 +02:00
MassimilianoPinto
6bb7aa4311 first implementation for depth of replication
first implementation for depth of replication for nodes
2014-06-17 18:16:45 +02:00
MassimilianoPinto
751b81a3b6 getServerByNodeId added
getServerByNodeId added
2014-06-17 18:07:30 +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
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
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
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
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
VilhoRaatikka
916b763685 Completed merge, fixed print delay to simple one. 2014-06-07 01:05:12 +03: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
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
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
Mark Riddoch
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
MassimilianoPinto
71bc2ba3ee set maxscale_id updated
set maxscale_id updated
2014-05-29 09:43:21 +02:00
MassimilianoPinto
c658c0fe9a Replication Lag parameter in diagnostics
Replication Lag parameter value is now printed in diagnostics routine
for MySQL monitor
2014-05-28 18:42:17 +02:00
MassimilianoPinto
4db9162bbc diagnostic routines updated
diagnostic routines updated
2014-05-28 17:56:18 +02:00
MassimilianoPinto
e4545baf97 Node Replication Consistency
Node Replication Consistency
2014-05-28 17:27:09 +02:00
MassimilianoPinto
fe0fcd75e4 new monitor routines
new monitor routines
2014-05-28 15:44:51 +02:00
MassimilianoPinto
798dd6a5a6 Added routines for interval and defaultId (MySQL)
Added routines for interval and defaultId (MySQL)
2014-05-28 11:51:58 +02:00
MassimilianoPinto
f985e1cac5 server_id for MySQL replication set for each node
server_id for MySQL replication is now set for each node and
dprintServer* routines can print it as well
2014-05-28 10:43:01 +02:00
VilhoRaatikka
70115d35c9 Fix to bug #438 http://bugs.skysql.com/show_bug.cgi?id=438
Fixed some compiler warnings, added header includes, return values etc.
2014-05-27 17:07:41 +03:00
MassimilianoPinto
60e06080ff Monitor version update
Monitor version update
2014-05-26 14:05:29 +02:00
MassimilianoPinto
9b46bc063d Compile error
Compile error
2014-05-26 13:57:45 +02:00
MassimilianoPinto
cde204db47 MariaDB 10 Replication support
MariaDB 10 Replication support
2014-05-26 10:09:01 +02:00
vraatikka
d403018fd9 Surrounded every log writing command with LOGIF macro, which tests if the given logfile id matches with those enabled. The comparison is done against local variable and expensive function call is avoided. 2013-12-12 16:14:33 +02:00
vraatikka
80b67d1083 log_manager.cc:
State update for filewriter was missing and that caused Maxscale to fail if opening of any log file failed.
dcb.c:
	Added EAGAIN and EWOULDBLOCK handling to dcb_read. If dcb_close is called for freshly created dcb, dcb is only freed.
gateway.c:
	Added file_write_footer and write_footer of which the latter is called at exit time. It simply draws a line to screen.
gw_utils.c:
	Some macros for helping comparison between gw_read_gwbuff and dcb_read, which overlap.
poll.c:
	Some macros to help enable/disable mutexing in poll_waitevents
service.c:
	Check return value of listen and session_alloc and behave accordingly.

mysql_client.c:
	If ioctl returned successfully with b==0 it earlier caused closing the client and backend dcbs. Since that doesn't reliably indicate that client has closed socket on its side, Maxscale doesn't close its sockets either.
mysql_common.c:
	In gw_receive_backend_auth, if dcb_read returns n==0, it is not considered as an error anymore. The implemented behavior is not yet complete and correct. Result should be successful but the protocol state shouldn't change to MYSQL_IDLE before backend return is received.
	In gw_send_authentication_to_backend protocol state was always set to MYSQL_AUTH_RECV even if gw_rwite had failed. Now, return value is read and state is set in caller's context basen on the return value.
skygw_utils.cc:
	Removed ss_dassert from skyge_file_init because it prevented from returning meaningful error meassage to the client.:
2013-10-06 22:31:32 +03:00
vraatikka
0c5125a44d Typos 2013-08-12 13:11:05 +03:00
vraatikka
cae4d38a7e Removed unnecessary argument from log manager commands because it is not used and it is always NULL. 2013-08-04 23:30:47 +03:00
Timofey Turenko
a7c82310f9 moving files to /server to make merge possible 2013-07-28 05:31:11 +00:00