Remove references to NDB server state

This commit is contained in:
Markus Mäkelä
2019-04-24 14:15:56 +03:00
parent 810dc06d5c
commit 6aedcc085f
6 changed files with 54 additions and 103 deletions

View File

@ -129,18 +129,14 @@ enum mxs_monitor_event_t
SYNCED_UP_EVENT = (1 << 7), /**< synced_up */
DONOR_DOWN_EVENT = (1 << 8), /**< donor_down */
DONOR_UP_EVENT = (1 << 9), /**< donor_up */
NDB_DOWN_EVENT = (1 << 10), /**< ndb_down */
NDB_UP_EVENT = (1 << 11), /**< ndb_up */
LOST_MASTER_EVENT = (1 << 12), /**< lost_master */
LOST_SLAVE_EVENT = (1 << 13), /**< lost_slave */
LOST_SYNCED_EVENT = (1 << 14), /**< lost_synced */
LOST_DONOR_EVENT = (1 << 15), /**< lost_donor */
LOST_NDB_EVENT = (1 << 16), /**< lost_ndb */
NEW_MASTER_EVENT = (1 << 17), /**< new_master */
NEW_SLAVE_EVENT = (1 << 18), /**< new_slave */
NEW_SYNCED_EVENT = (1 << 19), /**< new_synced */
NEW_DONOR_EVENT = (1 << 20), /**< new_donor */
NEW_NDB_EVENT = (1 << 21), /**< new_ndb */
LOST_MASTER_EVENT = (1 << 10), /**< lost_master */
LOST_SLAVE_EVENT = (1 << 11), /**< lost_slave */
LOST_SYNCED_EVENT = (1 << 12), /**< lost_synced */
LOST_DONOR_EVENT = (1 << 13), /**< lost_donor */
NEW_MASTER_EVENT = (1 << 14), /**< new_master */
NEW_SLAVE_EVENT = (1 << 15), /**< new_slave */
NEW_SYNCED_EVENT = (1 << 16), /**< new_synced */
NEW_DONOR_EVENT = (1 << 17), /**< new_donor */
};
enum credentials_approach_t

View File

@ -42,21 +42,21 @@ extern const char* DEFAULT_RANK;
* individual bits are independent, not all combinations make sense or are used. The bitfield is 64bits wide.
*/
// Bits used by most monitors
#define SERVER_RUNNING (1 << 0) /**<< The server is up and running */
#define SERVER_MAINT (1 << 1) /**<< Server is in maintenance mode */
#define SERVER_AUTH_ERROR (1 << 2) /**<< Authentication error from monitor */
#define SERVER_MASTER (1 << 3) /**<< The server is a master, i.e. can handle writes */
#define SERVER_SLAVE (1 << 4) /**<< The server is a slave, i.e. can handle reads */
#define SERVER_DRAINING (1 << 5) /**<< The server is being drained, i.e. no new connection should be created. */
#define SERVER_DISK_SPACE_EXHAUSTED (1 << 6) /**<< The disk space of the server is exhausted */
#define SERVER_RUNNING (1 << 0) /**<< The server is up and running */
#define SERVER_MAINT (1 << 1) /**<< Server is in maintenance mode */
#define SERVER_AUTH_ERROR (1 << 2) /**<< Authentication error from monitor */
#define SERVER_MASTER (1 << 3) /**<< The server is a master, i.e. can handle writes */
#define SERVER_SLAVE (1 << 4) /**<< The server is a slave, i.e. can handle reads */
#define SERVER_DRAINING (1 << 5) /**<< The server is being drained, i.e. no new connection
* should be created. */
#define SERVER_DISK_SPACE_EXHAUSTED (1 << 6) /**<< The disk space of the server is exhausted */
// Bits used by MariaDB Monitor (mostly)
#define SERVER_SLAVE_OF_EXT_MASTER (1 << 16) /**<< Server is slave of a non-monitored master */
#define SERVER_RELAY (1 << 17) /**<< Server is a relay */
#define SERVER_WAS_MASTER (1 << 18) /**<< Server was a master but lost all slaves. */
#define SERVER_SLAVE_OF_EXT_MASTER (1 << 16) /**<< Server is slave of a non-monitored master */
#define SERVER_RELAY (1 << 17) /**<< Server is a relay */
#define SERVER_WAS_MASTER (1 << 18) /**<< Server was a master but lost all slaves. */
// Bits used by other monitors
#define SERVER_JOINED (1 << 19) /**<< The server is joined in a Galera cluster */
#define SERVER_NDB (1 << 20) /**<< The server is part of a MySQL cluster setup */
#define SERVER_MASTER_STICKINESS (1 << 21) /**<< Server Master stickiness */
#define SERVER_JOINED (1 << 19) /**<< The server is joined in a Galera cluster */
#define SERVER_MASTER_STICKINESS (1 << 20) /**<< Server Master stickiness */
inline bool status_is_connectable(uint64_t status)
{
@ -108,11 +108,6 @@ inline bool status_is_joined(uint64_t status)
return (status & (SERVER_RUNNING | SERVER_JOINED | SERVER_MAINT)) == (SERVER_RUNNING | SERVER_JOINED);
}
inline bool status_is_ndb(uint64_t status)
{
return (status & (SERVER_RUNNING | SERVER_NDB | SERVER_MAINT)) == (SERVER_RUNNING | SERVER_NDB);
}
inline bool status_is_slave_of_ext_master(uint64_t status)
{
return (status & (SERVER_RUNNING | SERVER_SLAVE_OF_EXT_MASTER))
@ -429,19 +424,9 @@ public:
return status_is_joined(status);
}
/**
* Is the server a SQL node in MySQL Cluster?
*
* @return True, if server is running and with NDB status.
*/
bool is_ndb() const
{
return status_is_ndb(status);
}
bool is_in_cluster() const
{
return (status & (SERVER_MASTER | SERVER_SLAVE | SERVER_RELAY | SERVER_JOINED | SERVER_NDB)) != 0;
return (status & (SERVER_MASTER | SERVER_SLAVE | SERVER_RELAY | SERVER_JOINED)) != 0;
}
bool is_slave_of_ext_master() const