Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä
2020-03-02 18:05:11 +02:00
8 changed files with 103 additions and 142 deletions

View File

@ -8,9 +8,10 @@ The Consistent Critical Read (CCR) filter allows consistent critical reads to be
done through MaxScale while still allowing scaleout of non-critical reads. done through MaxScale while still allowing scaleout of non-critical reads.
When the filter detects a statement that would modify the database, it attaches When the filter detects a statement that would modify the database, it attaches
a routing hint to all following statements. This routing hint guides the routing a routing hint to all following statements done by that connection. This routing
module to route the statement to the master server where data is guaranteed to hint guides the routing module to route the statement to the master server where
be in an up-to-date state. data is guaranteed to be in an up-to-date state. Writes from one session do not,
by default, propagate to other sessions.
### Controlling the Filter with SQL Comments ### Controlling the Filter with SQL Comments

View File

@ -1,46 +1,6 @@
# MariaDB Monitor # MariaDB Monitor
Table of Contents [TOC]
=================
* [Overview](#overview)
* [Master selection](#master-selection)
* [Configuration](#configuration)
* [Common Monitor Parameters](#common-monitor-parameters)
* [MariaDB Monitor optional parameters](#mariadb-monitor-optional-parameters)
* [assume_unique_hostnames](#assume_unique_hostnames)
* [detect_replication_lag](#detect_replication_lag)
* [detect_stale_master](#detect_stale_master)
* [detect_stale_slave](#detect_stale_slave)
* [mysql51_replication](#mysql51_replication)
* [multimaster](#multimaster)
* [ignore_external_masters](#ignore_external_masters)
* [detect_standalone_master](#detect_standalone_master)
* [failcount](#failcount)
* [allow_cluster_recovery](#allow_cluster_recovery)
* [enforce_read_only_slaves](#enforce_read_only_slaves)
* [maintenance_on_low_disk_space](#maintenance_on_low_disk_space)
* [Cluster manipulation operations](#cluster-manipulation-operations)
* [Operation details](#operation-details)
* [Manual activation](#manual-activation)
* [Automatic activation](#automatic-activation)
* [Limitations and requirements](#limitations-and-requirements)
* [External master support](#external-master-support)
* [Configuration parameters](#configuration-parameters)
* [auto_failover](#auto_failover)
* [auto_rejoin](#auto_rejoin)
* [switchover_on_low_disk_space](#switchover_on_low_disk_space)
* [enforce_simple_topology](#enforce_simple_topology)
* [replication_user and replication_password](#replication_user-and-replication_password)
* [failover_timeout and switchover_timeout](#failover_timeout-and-switchover_timeout)
* [verify_master_failure and master_failure_timeout](#verify_master_failure-and-master_failure_timeout)
* [servers_no_promotion](#servers_no_promotion)
* [promotion_sql_file and demotion_sql_file](#promotion_sql_file-and-demotion_sql_file)
* [handle_events](#handle_events)
* [Troubleshooting](#troubleshooting)
* [Failover/switchover fails](#failoverswitchover-fails)
* [Slave detection shows external masters](#slave-detection-shows-external-masters)
* [Using the MariaDB Monitor With Binlogrouter](#using-the-mariadb-monitor-with-binlogrouter)
## Overview ## Overview
@ -261,6 +221,14 @@ multiple valid master servers in the cluster.
The default value is 5 failures. The default value is 5 failures.
The worst-case delay between the master failure and the start of the failover
can be calculated by summing up the timeout values and `monitor_interval` and
multiplying that by `failcount`:
```
(monitor_interval + backend_connect_timeout) * failcount
```
### `allow_cluster_recovery` ### `allow_cluster_recovery`
Deprecated and unused as of MaxScale 2.3. Can be defined but is ignored. Deprecated and unused as of MaxScale 2.3. Can be defined but is ignored.

View File

@ -252,6 +252,13 @@ the message will be logged on the notice level. Whitespace before, after or
between the keyword and the colon is ignored and the matching is between the keyword and the colon is ignored and the matching is
case-insensitive. case-insensitive.
Currently, the script must not execute any of the following MaxCtrl and/or
MaxAdmin calls as they cause a deadlock:
* `alter monitor` to the monitor executing the script
* `stop monitor` to the monitor executing the script
* `call command` to a MariaDB-Monitor that is executing the script
### `script_timeout` ### `script_timeout`
The timeout for the executed script. The interval is specified as documented The timeout for the executed script. The interval is specified as documented

View File

@ -4,24 +4,7 @@
# The Maxscale Administrative & Monitoring Client Application # The Maxscale Administrative & Monitoring Client Application
- [Overview](#overview) [TOC]
- [Configuring MariaDB MaxScale for MaxAdmin](#configuring-mariadb-maxscale-for-maxadmin)
- [Running MaxAdmin](#running-maxadmin)
- [Working With Administration Interface Users](#working-with-administration-interface-users)
- [Getting Help](#getting-help)
- [Working with Services](#working-with-services)
- [Working with Servers](#working-with-servers)
- [Working with Sessions](#working-with-sessions)
- [Descriptor Control Blocks](#descriptor-control-blocks)
- [Working with Filters](#working-with-filters)
- [Working with Monitors](#working-with-monitors)
- [MariaDB MaxScale Status Commands](#maxscale-status-commands)
- [Administration Commands](#administration-commands)
- [Runtime Configuration Changes](#runtime-configuration-changes)
- [Servers](#servers)
- [Listeners](#listeners)
- [Monitors](#monitors)
- [Tuning MariaDB MaxScale](#tuning-mariadb-maxscale)
# Overview # Overview

View File

@ -139,7 +139,8 @@ public:
NEWCONN_OK, /* No existing connection or no ping reply. New connection created NEWCONN_OK, /* No existing connection or no ping reply. New connection created
* successfully. */ * successfully. */
REFUSED, /* No existing connection or no ping reply. Server refused new connection. */ REFUSED, /* No existing connection or no ping reply. Server refused new connection. */
TIMEOUT /* No existing connection or no ping reply. Timeout on new connection. */ TIMEOUT, /* No existing connection or no ping reply. Timeout on new connection. */
ACCESS_DENIED /* Server refused new connection due to authentication failure */
}; };
/** /**

View File

@ -718,25 +718,20 @@ bool Monitor::test_permissions(const string& query)
for (MonitorServer* mondb : m_servers) for (MonitorServer* mondb : m_servers)
{ {
if (!connection_is_ok(mondb->ping_or_connect(m_settings.conn_settings))) auto result = mondb->ping_or_connect(m_settings.conn_settings);
if (!connection_is_ok(result))
{ {
MXS_ERROR("[%s] Failed to connect to server '%s' ([%s]:%d) when" MXS_ERROR("[%s] Failed to connect to server '%s' ([%s]:%d) when"
" checking monitor user credentials and permissions: %s", " checking monitor user credentials and permissions.",
name(), name(),
mondb->server->name(), mondb->server->name(),
mondb->server->address, mondb->server->address,
mondb->server->port, mondb->server->port);
mysql_error(mondb->con));
switch (mysql_errno(mondb->con))
{
case ER_ACCESS_DENIED_ERROR:
case ER_DBACCESS_DENIED_ERROR:
case ER_ACCESS_DENIED_NO_PASSWORD_ERROR:
break;
default: if (result != ConnectResult::ACCESS_DENIED)
{
rval = true; rval = true;
break;
} }
} }
else if (mxs_mysql_query(mondb->con, query.c_str()) != 0) else if (mxs_mysql_query(mondb->con, query.c_str()) != 0)
@ -1180,8 +1175,14 @@ Monitor::ping_or_connect_to_db(const MonitorServer::ConnectionSettings& sett, SE
conn_result = ConnectResult::TIMEOUT; conn_result = ConnectResult::TIMEOUT;
} }
auto err = mysql_errno(pConn);
mysql_close(pConn); mysql_close(pConn);
pConn = nullptr; pConn = nullptr;
if (err == ER_ACCESS_DENIED_ERROR || err == ER_ACCESS_DENIED_NO_PASSWORD_ERROR)
{
conn_result = ConnectResult::ACCESS_DENIED;
}
} }
MXS_FREE(dpwd); MXS_FREE(dpwd);
@ -2104,7 +2105,7 @@ void MonitorWorkerSimple::tick()
*/ */
pMs->clear_pending_status(MonitorServer::SERVER_DOWN_CLEAR_BITS); pMs->clear_pending_status(MonitorServer::SERVER_DOWN_CLEAR_BITS);
if (mysql_errno(pMs->con) == ER_ACCESS_DENIED_ERROR) if (rval == ConnectResult::ACCESS_DENIED)
{ {
pMs->set_pending_status(SERVER_AUTH_ERROR); pMs->set_pending_status(SERVER_AUTH_ERROR);
} }

View File

@ -251,7 +251,8 @@ bool MariaDBMonitor::configure(const MXS_CONFIG_PARAMETER* params)
m_settings.enforce_read_only_slaves = params->get_bool(CN_ENFORCE_READONLY); m_settings.enforce_read_only_slaves = params->get_bool(CN_ENFORCE_READONLY);
m_settings.enforce_simple_topology = params->get_bool(CN_ENFORCE_SIMPLE_TOPOLOGY); m_settings.enforce_simple_topology = params->get_bool(CN_ENFORCE_SIMPLE_TOPOLOGY);
m_settings.verify_master_failure = params->get_bool(CN_VERIFY_MASTER_FAILURE); m_settings.verify_master_failure = params->get_bool(CN_VERIFY_MASTER_FAILURE);
m_settings.master_failure_timeout = params->get_duration<std::chrono::seconds>(CN_MASTER_FAILURE_TIMEOUT).count(); m_settings.master_failure_timeout =
params->get_duration<std::chrono::seconds>(CN_MASTER_FAILURE_TIMEOUT).count();
m_settings.shared.promotion_sql_file = params->get_string(CN_PROMOTION_SQL_FILE); m_settings.shared.promotion_sql_file = params->get_string(CN_PROMOTION_SQL_FILE);
m_settings.shared.demotion_sql_file = params->get_string(CN_DEMOTION_SQL_FILE); m_settings.shared.demotion_sql_file = params->get_string(CN_DEMOTION_SQL_FILE);
m_settings.switchover_on_low_disk_space = params->get_bool(CN_SWITCHOVER_ON_LOW_DISK_SPACE); m_settings.switchover_on_low_disk_space = params->get_bool(CN_SWITCHOVER_ON_LOW_DISK_SPACE);

View File

@ -1221,7 +1221,6 @@ bool MariaDBServer::enable_events(BinlogMode binlog_mode, const EventNameSet& ev
return rval; return rval;
}; };
return alter_events(binlog_mode, mapper, error_out); return alter_events(binlog_mode, mapper, error_out);
} }
bool MariaDBServer::disable_events(BinlogMode binlog_mode, json_t** error_out) bool MariaDBServer::disable_events(BinlogMode binlog_mode, json_t** error_out)
@ -2234,8 +2233,8 @@ void MariaDBServer::update_server(bool time_to_update_disk_space,
/* The current server is not running. Clear some of the bits. User-set bits and some long-term bits /* The current server is not running. Clear some of the bits. User-set bits and some long-term bits
* can stay. */ * can stay. */
server->clear_status(MonitorServer::SERVER_DOWN_CLEAR_BITS); server->clear_status(MonitorServer::SERVER_DOWN_CLEAR_BITS);
auto conn_errno = mysql_errno(conn);
if (conn_errno == ER_ACCESS_DENIED_ERROR || conn_errno == ER_ACCESS_DENIED_NO_PASSWORD_ERROR) if (conn_status == ConnectResult::ACCESS_DENIED)
{ {
server->set_status(SERVER_AUTH_ERROR); server->set_status(SERVER_AUTH_ERROR);
} }