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.
This commit is contained in:
MassimilianoPinto
2014-09-01 11:18:57 +02:00
parent 493feb49ba
commit 63d267e5ef
8 changed files with 127 additions and 32 deletions

View File

@ -38,6 +38,7 @@
* 03/06/14 Mark Riddoch Addition of maintainance mode
* 20/06/14 Massimiliano Pinto Addition of master_id, depth, slaves fields
* 26/06/14 Mark Riddoch Adidtion of server parameters
* 30/08/14 Massimiliano Pinto Addition of SERVER_STALE_STATUS
*
* @endverbatim
*/
@ -101,6 +102,7 @@ typedef struct server {
#define SERVER_JOINED 0x0008 /**<< The server is joined in a Galera cluster */
#define SERVER_MAINT 0x1000 /**<< Server is in maintenance mode */
#define SERVER_SLAVE_OF_EXTERNAL_MASTER 0x0080 /**<< Server is slave of a Master outside the provided replication topology */
#define SERVER_STALE_STATUS 0x2000 /**<< Server stale status, monitor didn't update it */
/**
* Is the server running - the macro returns true if the server is marked as running