252 Commits

Author SHA1 Message Date
MassimilianoPinto
f09368924b Added depth level 0 for each cluster node
Added depth level 0 for each cluster node, this way the algorithm for
root master selection will the same as in mysql replication:

the root master is server at lowest replication depth  with MASTER bit
set

Here for Galera we assume all the servers are at the same level, that’s
0
2014-06-24 17:58:29 +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
31e2d4e12a monitor diagnostics update
monitor diagnostics update
2014-05-28 17:52:37 +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
MassimilianoPinto
78a02f5297 Compile warning fixed in galera_mon.c
Compile warning fixed in galera_mon.c
2014-05-28 09:39:33 +02:00
MassimilianoPinto
a45e009dfe Merge branch 'feature-MAX-58' into develop
Merge branch 'feature-MAX-58' into develop
2014-05-28 09:31:29 +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
b54ca8e87f Default values for MONITOR_INTERVAL
Default values for MONITOR_INTERVAL
2014-05-26 14:16:56 +02:00
MassimilianoPinto
0e510cfa4a Default values for MONITOR_INTERVAL
Default values for MONITOR_INTERVAL
2014-05-26 14:15:51 +02:00
MassimilianoPinto
330c0f6bf7 MONITOR_INTERVAL default added
MONITOR_INTERVAL default added
2014-05-26 14:13:01 +02:00
MassimilianoPinto
b17744fd46 Monitor Version Update
Monitor Version Update
2014-05-26 14:07:04 +02: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
bf00ca8aba GaleraHA support - R/W Splitting with Galera
GaleraHA support - R/W Splitting with Galera
2014-05-26 10:29:34 +02:00
MassimilianoPinto
cde204db47 MariaDB 10 Replication support
MariaDB 10 Replication support
2014-05-26 10:09:01 +02:00
Mark Riddoch
3edea0afc4 Updated gitignore files 2014-02-05 14:49:05 +01: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
f50de7a084 build_gateway.inc
Removed MARIADB_SRC_PATH
	Added MYSQL_ROOT - root directory where MariaDB headers are installed
	Added MYSQL_HEADERS - -I notation for three header directories
	Added EMBEDDED_LIB - for embedded library directory
	Added ERRMSG - for errmsg.sys file

log_manager.cc
	Little fixes

log_manager/makefile
	Updated header include directive

makefile.inc
	Removed DEBUGGER and BACKGR as unnecessary
	Added LIB for embedded library file name

query_classifier/makefile
	Updated header include directives and embedded library directory

query_classifier/query_classifier.cc
	clean up

server/core/Makefile
	Updated header include directives and embedded library directory
	Added libaio and install of errmsg.sys

server/core/dcb.c
	clean up

server/core/gateway.c
	Added --language and --skip-innodb to mysql_library_init command-line arguments list
	clean up

server/core/load_utils.c
	clean up

server/modules/monitor/Makefile
server/modules/routing/readwritesplit/Makefile
	Updated header include directives and embedded library directory

utils/skygw_debug.h
	http://bugs.skysql.com/show_bug.cgi?id=369

utils/skygw_types.h
utils/skygw_utils.cc
	clean up
2013-12-06 00:12:41 +02:00
Massimiliano Pinto
121cff7ffa Galera cluster status is Synced, all affected files are updated 2013-10-14 15:29:26 +02:00
Massimiliano Pinto
1f0e8d5c56 Fixed: use row[1] instead of row[0] in monitorDatabase() 2013-10-11 09:02:49 +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
Mark Riddoch
2135a76f7b Bug 172 - Compile errors in Galera Monitor 2013-08-21 17:25:43 +02: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
vraatikka
b71b22b18a Removed dependency files because they are now created as a part of makefile processing. 2013-07-30 15:07:50 +03:00
vraatikka
f3cf1d703e Removed depend.mk files. Added command 'touch depend.mk' to each Makefile which attempts to include depend.mk. That is for the makefile process phase where only the existence of depend.mk is checked. Later the real file is created in 'depend' target. 2013-07-30 11:43:39 +03:00