Remove SERVER_WAS_SLAVE status bit

Was unused due to MariaDBMonitor changes.
This commit is contained in:
Esa Korhonen
2018-08-10 17:15:00 +03:00
parent eab0a22518
commit e5a90d63e1
2 changed files with 8 additions and 15 deletions

View File

@ -184,11 +184,10 @@ enum
#define SERVER_SLAVE_OF_EXT_MASTER (1 << 5) /**<< Server is slave of a non-monitored master */ #define SERVER_SLAVE_OF_EXT_MASTER (1 << 5) /**<< Server is slave of a non-monitored master */
#define SERVER_RELAY (1 << 6) /**<< Server is a relay */ #define SERVER_RELAY (1 << 6) /**<< Server is a relay */
#define SERVER_WAS_MASTER (1 << 7) /**<< Server was a master but lost all slaves. */ #define SERVER_WAS_MASTER (1 << 7) /**<< Server was a master but lost all slaves. */
#define SERVER_WAS_SLAVE (1 << 8) /**<< Server was a slave but lost its master. */
// Bits used by other monitors // Bits used by other monitors
#define SERVER_JOINED (1 << 9) /**<< The server is joined in a Galera cluster */ #define SERVER_JOINED (1 << 8) /**<< The server is joined in a Galera cluster */
#define SERVER_NDB (1 << 10) /**<< The server is part of a MySQL cluster setup */ #define SERVER_NDB (1 << 9) /**<< The server is part of a MySQL cluster setup */
#define SERVER_MASTER_STICKINESS (1 << 11) /**<< Server Master stickiness */ #define SERVER_MASTER_STICKINESS (1 << 10) /**<< Server Master stickiness */
// Bits providing general information // Bits providing general information
#define SERVER_DISK_SPACE_EXHAUSTED (1 << 31) /**<< The disk space of the server is exhausted */ #define SERVER_DISK_SPACE_EXHAUSTED (1 << 31) /**<< The disk space of the server is exhausted */

View File

@ -30,8 +30,6 @@ static bool check_replicate_wild_ignore_table(MXS_MONITORED_SERVER* database);
static const char HB_TABLE_NAME[] = "maxscale_schema.replication_heartbeat"; static const char HB_TABLE_NAME[] = "maxscale_schema.replication_heartbeat";
static const int64_t MASTER_BITS = SERVER_MASTER | SERVER_WAS_MASTER; static const int64_t MASTER_BITS = SERVER_MASTER | SERVER_WAS_MASTER;
static const int64_t SLAVE_BITS = SERVER_SLAVE | SERVER_WAS_SLAVE;
/** /**
* Generic depth-first search. Iterates through child nodes (slaves) and runs the 'visit_func' on the nodes. * Generic depth-first search. Iterates through child nodes (slaves) and runs the 'visit_func' on the nodes.
@ -639,8 +637,8 @@ void MariaDBMonitor::assign_server_roles()
{ {
// Remove any existing [Master], [Slave] etc flags from 'pending_status', they are still available in // Remove any existing [Master], [Slave] etc flags from 'pending_status', they are still available in
// 'mon_prev_status'. // 'mon_prev_status'.
const uint64_t remove_bits = SERVER_MASTER | SERVER_WAS_MASTER | SERVER_SLAVE | SERVER_WAS_SLAVE | const uint64_t remove_bits = SERVER_MASTER | SERVER_WAS_MASTER | SERVER_SLAVE | SERVER_RELAY |
SERVER_RELAY | SERVER_SLAVE_OF_EXT_MASTER; SERVER_SLAVE_OF_EXT_MASTER;
for (auto server : m_servers) for (auto server : m_servers)
{ {
server->clear_status(remove_bits); server->clear_status(remove_bits);
@ -657,7 +655,7 @@ void MariaDBMonitor::assign_server_roles()
if (m_master->is_running()) if (m_master->is_running())
{ {
// Master is running, assign bits for valid replication. // Master is running, assign bits for valid replication.
m_master->clear_status(SLAVE_BITS | SERVER_RELAY); m_master->clear_status(SERVER_SLAVE | SERVER_RELAY);
m_master->set_status(MASTER_BITS); m_master->set_status(MASTER_BITS);
// Run another graph search, this time assigning slaves. // Run another graph search, this time assigning slaves.
reset_node_index_info(); reset_node_index_info();
@ -782,11 +780,7 @@ void MariaDBMonitor::assign_slave_and_relay_master(MariaDBServer* start_node)
slave->clear_status(MASTER_BITS); slave->clear_status(MASTER_BITS);
if (slave->is_running()) if (slave->is_running())
{ {
slave->set_status(SLAVE_BITS); slave->set_status(SERVER_SLAVE);
}
else if (allow_stale_slaves)
{
slave->set_status(SERVER_WAS_SLAVE);
} }
} }
} }
@ -801,7 +795,7 @@ void MariaDBMonitor::assign_slave_and_relay_master(MariaDBServer* start_node)
// Relay master bit can stay. // Relay master bit can stay.
if (parent->m_version == MariaDBServer::version::BINLOG_ROUTER) if (parent->m_version == MariaDBServer::version::BINLOG_ROUTER)
{ {
parent->clear_status(SLAVE_BITS); parent->clear_status(SERVER_SLAVE);
} }
} }
} }