diff --git a/include/maxscale/monitor.hh b/include/maxscale/monitor.hh index 8260a9e09..658232cae 100644 --- a/include/maxscale/monitor.hh +++ b/include/maxscale/monitor.hh @@ -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 diff --git a/include/maxscale/server.hh b/include/maxscale/server.hh index c85cb4110..8e4b2fd9d 100644 --- a/include/maxscale/server.hh +++ b/include/maxscale/server.hh @@ -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 diff --git a/server/core/internal/monitor.hh b/server/core/internal/monitor.hh index a0cd9d0f2..5e519bfaf 100644 --- a/server/core/internal/monitor.hh +++ b/server/core/internal/monitor.hh @@ -28,28 +28,24 @@ static const MXS_ENUM_VALUE mxs_monitor_event_default_enum = {"all", ~0ULL}; static const MXS_ENUM_VALUE mxs_monitor_event_enum_values[] = { mxs_monitor_event_default_enum, - {"master_down", MASTER_DOWN_EVENT }, - {"master_up", MASTER_UP_EVENT }, - {"slave_down", SLAVE_DOWN_EVENT }, - {"slave_up", SLAVE_UP_EVENT }, - {"server_down", SERVER_DOWN_EVENT }, - {"server_up", SERVER_UP_EVENT }, - {"synced_down", SYNCED_DOWN_EVENT }, - {"synced_up", SYNCED_UP_EVENT }, - {"donor_down", DONOR_DOWN_EVENT }, - {"donor_up", DONOR_UP_EVENT }, - {"ndb_down", NDB_DOWN_EVENT }, - {"ndb_up", NDB_UP_EVENT }, - {"lost_master", LOST_MASTER_EVENT }, - {"lost_slave", LOST_SLAVE_EVENT }, - {"lost_synced", LOST_SYNCED_EVENT }, - {"lost_donor", LOST_DONOR_EVENT }, - {"lost_ndb", LOST_NDB_EVENT }, - {"new_master", NEW_MASTER_EVENT }, - {"new_slave", NEW_SLAVE_EVENT }, - {"new_synced", NEW_SYNCED_EVENT }, - {"new_donor", NEW_DONOR_EVENT }, - {"new_ndb", NEW_NDB_EVENT }, + {"master_down", MASTER_DOWN_EVENT}, + {"master_up", MASTER_UP_EVENT}, + {"slave_down", SLAVE_DOWN_EVENT}, + {"slave_up", SLAVE_UP_EVENT}, + {"server_down", SERVER_DOWN_EVENT}, + {"server_up", SERVER_UP_EVENT}, + {"synced_down", SYNCED_DOWN_EVENT}, + {"synced_up", SYNCED_UP_EVENT}, + {"donor_down", DONOR_DOWN_EVENT}, + {"donor_up", DONOR_UP_EVENT}, + {"lost_master", LOST_MASTER_EVENT}, + {"lost_slave", LOST_SLAVE_EVENT}, + {"lost_synced", LOST_SYNCED_EVENT}, + {"lost_donor", LOST_DONOR_EVENT}, + {"new_master", NEW_MASTER_EVENT}, + {"new_slave", NEW_SLAVE_EVENT}, + {"new_synced", NEW_SYNCED_EVENT}, + {"new_donor", NEW_DONOR_EVENT}, {NULL} }; diff --git a/server/core/monitor.cc b/server/core/monitor.cc index 641083354..fc052284f 100644 --- a/server/core/monitor.cc +++ b/server/core/monitor.cc @@ -159,11 +159,11 @@ const char* monitor_state_to_string(monitor_state_t state) } /** Server type specific bits */ -const uint64_t server_type_bits = SERVER_MASTER | SERVER_SLAVE | SERVER_JOINED | SERVER_NDB; +const uint64_t server_type_bits = SERVER_MASTER | SERVER_SLAVE | SERVER_JOINED; /** All server bits */ const uint64_t all_server_bits = SERVER_RUNNING | SERVER_MAINT | SERVER_MASTER | SERVER_SLAVE - | SERVER_JOINED | SERVER_NDB; + | SERVER_JOINED; const char journal_name[] = "monitor.dat"; const char journal_template[] = "%s/%s/%s"; @@ -1226,12 +1226,7 @@ mxs_monitor_event_t MonitorServer::get_event_type() const case UP_EVENT: rval = (present & SERVER_MASTER) ? MASTER_UP_EVENT : (present & SERVER_SLAVE) ? SLAVE_UP_EVENT : - (present - & SERVER_JOINED) ? SYNCED_UP_EVENT : - (present - & SERVER_NDB) ? - NDB_UP_EVENT - : + (present & SERVER_JOINED) ? SYNCED_UP_EVENT : SERVER_UP_EVENT; break; @@ -1239,10 +1234,6 @@ mxs_monitor_event_t MonitorServer::get_event_type() const rval = (prev & SERVER_MASTER) ? MASTER_DOWN_EVENT : (prev & SERVER_SLAVE) ? SLAVE_DOWN_EVENT : (prev & SERVER_JOINED) ? SYNCED_DOWN_EVENT : - (prev - & SERVER_NDB) ? - NDB_DOWN_EVENT - : SERVER_DOWN_EVENT; break; @@ -1250,22 +1241,13 @@ mxs_monitor_event_t MonitorServer::get_event_type() const rval = (prev & SERVER_MASTER) ? LOST_MASTER_EVENT : (prev & SERVER_SLAVE) ? LOST_SLAVE_EVENT : (prev & SERVER_JOINED) ? LOST_SYNCED_EVENT : - (prev - & SERVER_NDB) ? - LOST_NDB_EVENT - : UNDEFINED_EVENT; break; case NEW_EVENT: rval = (present & SERVER_MASTER) ? NEW_MASTER_EVENT : (present & SERVER_SLAVE) ? NEW_SLAVE_EVENT : - (present - & SERVER_JOINED) ? NEW_SYNCED_EVENT : - (present - & SERVER_NDB) ? - NEW_NDB_EVENT - : + (present & SERVER_JOINED) ? NEW_SYNCED_EVENT : UNDEFINED_EVENT; break; diff --git a/server/core/server.cc b/server/core/server.cc index 406595a1b..42b27007f 100644 --- a/server/core/server.cc +++ b/server/core/server.cc @@ -643,7 +643,6 @@ string SERVER::status_to_string(uint64_t flags, int nConnections) const string relay = "Relay Master"; const string slave = "Slave"; const string synced = "Synced"; - const string ndb = "NDB"; const string slave_ext = "Slave of External Server"; const string sticky = "Master Stickiness"; const string auth_err = "Auth Error"; @@ -683,7 +682,6 @@ string SERVER::status_to_string(uint64_t flags, int nConnections) // The following Galera and Cluster bits may be combined with master/slave. concatenate_if(status_is_joined(flags), synced); - concatenate_if(status_is_ndb(flags), ndb); // May be combined with other MariaDB monitor flags. concatenate_if(flags & SERVER_SLAVE_OF_EXT_MASTER, slave_ext); @@ -847,16 +845,15 @@ uint64_t SERVER::status_from_string(const char* str) uint64_t bit; } ServerBits[] = { - {"running", SERVER_RUNNING }, - {"master", SERVER_MASTER }, - {"slave", SERVER_SLAVE }, - {"synced", SERVER_JOINED }, - {"ndb", SERVER_NDB }, - {"maintenance", SERVER_MAINT }, - {"maint", SERVER_MAINT }, - {"stale", SERVER_WAS_MASTER }, - {"drain", SERVER_DRAINING }, - {NULL, 0 } + {"running", SERVER_RUNNING}, + {"master", SERVER_MASTER}, + {"slave", SERVER_SLAVE}, + {"synced", SERVER_JOINED}, + {"maintenance", SERVER_MAINT}, + {"maint", SERVER_MAINT}, + {"stale", SERVER_WAS_MASTER}, + {"drain", SERVER_DRAINING}, + {NULL, 0} }; for (int i = 0; ServerBits[i].str; i++) diff --git a/server/modules/routing/readconnroute/readconnroute.cc b/server/modules/routing/readconnroute/readconnroute.cc index 716727076..98524bfa2 100644 --- a/server/modules/routing/readconnroute/readconnroute.cc +++ b/server/modules/routing/readconnroute/readconnroute.cc @@ -137,15 +137,10 @@ bool RCR::configure(MXS_CONFIG_PARAMETER* params) bitmask |= (SERVER_JOINED); bitvalue |= SERVER_JOINED; } - else if (!strcasecmp(opt.c_str(), "ndb")) - { - bitmask |= (SERVER_NDB); - bitvalue |= SERVER_NDB; - } else { MXS_ERROR("Unsupported router option \'%s\' for readconnroute. " - "Expected router options are [slave|master|synced|ndb|running]", + "Expected router options are [slave|master|synced|running]", opt.c_str()); ok = false; }