Merge branch '2.2' into 2.3
This commit is contained in:
@ -26,8 +26,6 @@
|
||||
#include <maxscale/routingworker.h>
|
||||
#include <maxscale/secrets.h>
|
||||
#include <maxscale/utils.hh>
|
||||
// TODO: For monitor_add_parameters
|
||||
#include "../../../core/internal/monitor.h"
|
||||
|
||||
using std::string;
|
||||
using maxscale::string_printf;
|
||||
@ -440,6 +438,11 @@ void MariaDBMonitor::tick()
|
||||
mon_srv->mon_prev_status = status;
|
||||
}
|
||||
|
||||
if (cluster_operation_disable_timer > 0)
|
||||
{
|
||||
cluster_operation_disable_timer--;
|
||||
}
|
||||
|
||||
// Query all servers for their status.
|
||||
for (MariaDBServer* server : m_servers)
|
||||
{
|
||||
@ -457,7 +460,7 @@ void MariaDBMonitor::tick()
|
||||
update_topology();
|
||||
m_cluster_topology_changed = false;
|
||||
// If cluster operations are enabled, check topology support and disable if needed.
|
||||
if (m_auto_failover || m_switchover_on_low_disk_space)
|
||||
if (m_auto_failover || m_switchover_on_low_disk_space || m_auto_rejoin)
|
||||
{
|
||||
check_cluster_operations_support();
|
||||
}
|
||||
@ -530,16 +533,16 @@ void MariaDBMonitor::process_state_changes()
|
||||
}
|
||||
}
|
||||
|
||||
if (!config_get_global_options()->passive)
|
||||
if (can_perform_cluster_ops())
|
||||
{
|
||||
if (m_auto_failover && !m_cluster_modified)
|
||||
if (m_auto_failover)
|
||||
{
|
||||
handle_auto_failover();
|
||||
}
|
||||
|
||||
// Do not auto-join servers on this monitor loop if a failover (or any other cluster modification)
|
||||
// has been performed, as server states have not been updated yet. It will happen next iteration.
|
||||
if (m_auto_rejoin && !m_cluster_modified && cluster_can_be_joined())
|
||||
if (m_auto_rejoin && cluster_can_be_joined() && can_perform_cluster_ops())
|
||||
{
|
||||
// Check if any servers should be autojoined to the cluster and try to join them.
|
||||
handle_auto_rejoin();
|
||||
@ -548,13 +551,13 @@ void MariaDBMonitor::process_state_changes()
|
||||
/* Check if any slave servers have read-only off and turn it on if user so wishes. Again, do not
|
||||
* perform this if cluster has been modified this loop since it may not be clear which server
|
||||
* should be a slave. */
|
||||
if (m_enforce_read_only_slaves && !m_cluster_modified)
|
||||
if (m_enforce_read_only_slaves && can_perform_cluster_ops())
|
||||
{
|
||||
enforce_read_only_on_slaves();
|
||||
}
|
||||
|
||||
/* Check if the master server is on low disk space and act on it. */
|
||||
if (m_switchover_on_low_disk_space && !m_cluster_modified)
|
||||
if (m_switchover_on_low_disk_space && can_perform_cluster_ops())
|
||||
{
|
||||
handle_low_disk_space_master();
|
||||
}
|
||||
@ -683,25 +686,6 @@ void MariaDBMonitor::assign_new_master(MariaDBServer* new_master)
|
||||
m_warn_have_better_master = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a monitor config parameter to "false". The effect persists over stopMonitor/startMonitor but not
|
||||
* MaxScale restart. Only use on boolean config settings.
|
||||
*
|
||||
* @param setting_name Setting to disable
|
||||
*/
|
||||
void MariaDBMonitor::disable_setting(const std::string& setting)
|
||||
{
|
||||
Worker* worker = static_cast<Worker*>(mxs_rworker_get(MXS_RWORKER_MAIN));
|
||||
|
||||
worker->execute([=]() {
|
||||
MXS_CONFIG_PARAMETER p = {};
|
||||
p.name = const_cast<char*>(setting.c_str());
|
||||
p.value = const_cast<char*>("false");
|
||||
monitor_add_parameters(m_monitor, &p);
|
||||
},
|
||||
EXECUTE_AUTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check sql text file parameters. A parameter should either be empty or a valid file which can be opened.
|
||||
*
|
||||
|
Reference in New Issue
Block a user