108 Commits

Author SHA1 Message Date
VilhoRaatikka
2b147a9ea4 Monitors waited monitor check interval time before checking backend servers for the first time. Removed wait for the first check.
Added extra debugging to query_classifier to assist in issue resolution regarding to optimized MaxScale builds and pthread_mutex_lock in sql/sql_class.h
2014-09-24 12:03:04 +03:00
VilhoRaatikka
45f8585804 Fix to bug #549, http://bugs.skysql.com/show_bug.cgi?id=549
Each monitor loops 10 times/second (sleep 100ms) and perform monitoring checks only when monitor's interval is spent. Monitors notice faster if the shutdown flag is set and thus overall shutdown is faster.
hint.c:added missing header
Changed interval from unsigned long to size_t which is guaranteed to be of same size also in windows (if possible).
2014-09-23 11:26:15 +03:00
MassimilianoPinto
ffc7e7aa10 Fix for server_string memory leak
Fix for server_string memory leak
2014-09-12 15:36:22 +02:00
Mark Riddoch
d1b4852d29 Addition of server "Auth Error" status 2014-09-12 08:55:32 +01:00
MassimilianoPinto
63d267e5ef Fix for broken replication
Fix for broken replication has been added to mysql_monitor.
Both Slave_IO  and Slave_SQL threads must be running in order to assign
the SERVER_SLAVE status but If only Slave_IO is running let’s assign
the master_id to current server and continue building the replication
tree; if no slaves at all the master will be still available.
The “detect_stale_master” option has been added, its default is 0.
If set to 1 the monitor will keep the last detected master even if the
replication setup is completely not working, i.e. both Slave_IO  and
Slave_SQL threads are not running: this applies only to the server that
was master before.
After monitor or MaxScale are restarted and the replication is still
stopped or not configured there will be no master because it’s not
possible to compute the replication topology tree.
2014-09-01 11:18:57 +02:00
Mark Riddoch
4af2e58c86 Update plugin status to BETA 2014-07-04 09:23:40 +01:00
MassimilianoPinto
ff99cd3c63 no rows for slave heartbeat reset server values
no rows for slave heartbeat resets the heartbeat and node_ts in server
struct
2014-07-01 10:36:26 +02:00
MassimilianoPinto
439cedc800 Fixed num servers counter
Fixed num servers counter
2014-06-30 19:33:30 +02:00
MassimilianoPinto
dd54dde4ef fix for root master NULL pinter
fix for  root master NULL pinter
2014-06-30 19:09:50 +02:00
VilhoRaatikka
0b89245a4b Merge branch 'develop' into MAX-167
Conflicts:
	server/modules/monitor/mysql_mon.c
	server/modules/routing/readwritesplit/readwritesplit.c
2014-06-30 14:17:00 +03:00
MassimilianoPinto
32526d31b6 code cleanup
code cleanup
2014-06-27 18:14:46 +02:00
MassimilianoPinto
3a299a9ed8 get_replication_tree checks for SERVER_IS_DOWN
get_replication_tree checks for SERVER_IS_DOWN, this will produce a
replication tree even with servers in SERVER_IN_MAINT state
2014-06-27 17:16:38 +02:00
MassimilianoPinto
3e83174cd8 Log messages updated for Replication heartbeat
Log messages updated for Replication heartbeat
2014-06-27 15:10:25 +02:00
MassimilianoPinto
111693775b master_id and node_id are long vars
master_id and node_id are long vars
2014-06-27 14:21:12 +02:00
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