MXS-2220 Move server status functions inside class

This commit is contained in:
Esa Korhonen
2019-01-04 17:34:50 +02:00
parent 49c1afcb1b
commit 8b53e30678
14 changed files with 143 additions and 149 deletions

View File

@ -371,7 +371,7 @@ MXS_MONITORED_SERVER* GaleraMonitor::get_candidate_master()
/* set min_id to the lowest value of moitor_servers->server->node_id */
while (moitor_servers)
{
if (!server_is_in_maint(moitor_servers->server)
if (!moitor_servers->server->is_in_maint()
&& (moitor_servers->pending_status & SERVER_JOINED))
{
if (m_use_priority)
@ -454,7 +454,7 @@ static MXS_MONITORED_SERVER* set_cluster_master(MXS_MONITORED_SERVER* current_ma
*
*/
if ((current_master->pending_status & SERVER_JOINED)
&& (!server_is_in_maint(current_master->server)))
&& (!current_master->server->is_in_maint()))
{
return current_master;
}

View File

@ -1276,8 +1276,8 @@ bool MariaDBMonitor::is_candidate_better(const MariaDBServer* candidate, const M
// If both have log_slave_updates on ...
else if (cand_updates && curr_updates)
{
bool cand_disk_ok = !server_is_disk_space_exhausted(candidate->m_server_base->server);
bool curr_disk_ok = !server_is_disk_space_exhausted(current_best->m_server_base->server);
bool cand_disk_ok = !candidate->m_server_base->server->is_low_on_disk_space();
bool curr_disk_ok = !current_best->m_server_base->server->is_low_on_disk_space();
// ... prefer a slave without disk space issues.
if (cand_disk_ok && !curr_disk_ok)
{

View File

@ -324,7 +324,7 @@ void MMMonitor::post_tick()
for (MXS_MONITORED_SERVER* ptr = m_monitor->monitored_servers; ptr; ptr = ptr->next)
{
if (!server_is_in_maint(ptr->server))
if (!ptr->server->is_in_maint())
{
/* If "detect_stale_master" option is On, let's use the previus master */
if (m_detectStaleMaster && root_master
@ -375,7 +375,7 @@ MXS_MONITORED_SERVER* MMMonitor::get_current_master()
* that means SERVER_IS_RUNNING returns 0
* Let's check only for SERVER_IS_DOWN: server is not running
*/
if (server_is_down(ptr->server))
if (ptr->server->is_down())
{
ptr = ptr->next;
continue;
@ -397,7 +397,7 @@ MXS_MONITORED_SERVER* MMMonitor::get_current_master()
if (m_master != NULL)
{
/* If the root master is in MAINT, return NULL */
if (server_is_in_maint(m_master->server))
if (m_master->server->is_in_maint())
{
return NULL;
}