19 Commits

Author SHA1 Message Date
Johan Wikman
e41589be10 Move headers from server/include to include/maxscale
- Headers now to be included as <maxscale/xyz.h>
- First step, no cleanup of headers has been made. Only moving
  from one place to another + necessary modifications.
2016-10-13 16:19:20 +03:00
Markus Makela
9b2209a8d1 Log only one warning when failover is initiated
Mysqlmon would log a warning at every monitoring interval when failover
was initiated.
2016-10-06 16:53:37 +03:00
Markus Makela
81fa8c6c0c Assign master status immediately to the replacement master
As the failover status check is done after the pending status has been
moved to the current status, the do_failover should set the current status
of the server as Master.
2016-10-06 14:30:02 +03:00
Markus Makela
c919511ba7 Implement simple failover mode into mysqlmon
The mysqlmon simple failover mode allows it to direct write traffic to a
secondary node. This enables a very simple failover mode with MaxScale
when it is used in a two node master-slave setup.
2016-09-26 11:00:16 +03:00
Markus Makela
ca9021b835 Merge branch '2.0' into develop 2016-09-21 02:51:27 +03:00
Markus Makela
60955ba70d Clean up mysqlmon after pull request merge
The pull request introduced some minor whitespace errors.
2016-09-20 09:23:58 +03:00
TheTuxKeeper
e849297fc8 line length now less than 110 characters 2016-09-20 09:23:58 +03:00
Daniel
48456833da fixed memleak and potential call of mysql_num_rows with NULL 2016-09-20 09:23:58 +03:00
counterpoint
73c974c286 Remove automatic create database - requires too powerful database user. 2016-09-20 09:23:58 +03:00
counterpoint
ec42413db8 Initial changes to implement test before creating maxscale_schema. 2016-09-20 09:23:57 +03:00
Markus Makela
ff7634113b Assign Relay Master only to running servers
The Relay Master status was set for servers that were down. The check for
valid master and node IDs was missing which caused a false positive.
2016-09-15 07:13:10 +03:00
Markus Makela
36e243e07d Refactor monitor_mysql_db functions
The different server monitoring functions all did similar work and
combining them into one function makes the whole process of monitoring a
server simpler.
2016-09-12 15:57:27 +03:00
Markus Makela
4cd36161ee Fix stale master detection in multimaster mode
The MySQL monitor now correctly assigns stale status to master servers.
2016-09-12 15:57:27 +03:00
Markus Makela
506ef1b9f6 Assign master status only to root level masters
If a relay master server is found in the replication tree, it should not
get the master status. Previously all master servers were assigned the
master status regardless of their depth in the replication tree.

By comparing the depth value of each potential master, the monitor can
find the right master at the root of the replication tree.
2016-09-12 15:57:27 +03:00
Markus Makela
46c8a6f66b MXS-839: Detect multi-master topologies with mysqlmon
The mysqlmon now supports proper detection of multi-master topologies by
building a directed graph out of the monitored server. If cycles are found from
this graph, they are assigned a master group ID. All servers with a positive
master group ID will receive the Master status unless they have `@@read_only`
enabled.

This new functionality can be enabled with the 'multimaster' boolean
parameter.
2016-09-12 15:57:27 +03:00
Markus Makela
d745781bd0 MXS-839: Store additional server information in mysqlmon
Mysqlmon now stores the values of read_only, slave_sql_running,
slave_io_running, the name and position of the masters binlog and the
replication configuration status of the slave.

This allows more detailed server information to be displayed with the
`show monitor <name>` diagnostic interface. In addition to this, the new
structure used to store them provides an easy way to store information
that is specific to a monitor and the servers it monitors.

These new status variables can be used to implement better multi-master
detection in mysqlmon by using the value of read_only to resolve
situations where multiple master candidates are available.
2016-09-12 15:57:27 +03:00
Johan Wikman
d7f79942be Merge branch '2.0' into develop 2016-09-09 15:12:58 +03:00
Johan Wikman
3eb25df676 Update monitor APIs
No need to use void* as the types of the arguments in the monitor
functions as the types are known and will always be the same.
2016-08-19 11:21:01 +03:00
Johan Wikman
cf7988c8e3 Move all monitors into subdirs of their own
Each monitor module now resides in a subdirectory of its own.
The name of the subdirectory is the same as the name of the
library in the module's CMakeLists.txt file.
2016-08-18 13:35:28 +03:00