Separate unknown server version from old versions
This allows better failover support detection.
This commit is contained in:
parent
ddc422b102
commit
681c456bd7
@ -1355,7 +1355,10 @@ bool MariaDBMonitor::cluster_supports_failover(string* reasons_out)
|
||||
// Gtid-replication is required, and a server version which supports it.
|
||||
for (MariaDBServer* server : m_servers)
|
||||
{
|
||||
if (server->m_version != MariaDBServer::version::MARIADB_100)
|
||||
// Need to accept unknown versions here. Otherwise servers which are down when the monitor starts
|
||||
// would deactivate failover.
|
||||
if (server->m_version != MariaDBServer::version::UNKNOWN &&
|
||||
server->m_version != MariaDBServer::version::MARIADB_100)
|
||||
{
|
||||
*reasons_out += separator + string_printf("The version of server '%s' is not supported. Failover "
|
||||
"requires MariaDB 10.X.", server->name());
|
||||
|
@ -356,7 +356,9 @@ void MariaDBMonitor::update_server(MariaDBServer& server)
|
||||
server.update_server_version();
|
||||
}
|
||||
|
||||
if (server.m_version != MariaDBServer::version::UNKNOWN)
|
||||
if (server.m_version == MariaDBServer::version::MARIADB_MYSQL_55 ||
|
||||
server.m_version == MariaDBServer::version::MARIADB_100 ||
|
||||
server.m_version == MariaDBServer::version::BINLOG_ROUTER)
|
||||
{
|
||||
// Check permissions if permissions failed last time or if this is a new connection.
|
||||
if (server.had_status(SERVER_AUTH_ERROR) || conn_status == MONITOR_CONN_NEWCONN_OK)
|
||||
|
@ -874,6 +874,7 @@ void MariaDBServer::update_server_version()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_version = version::OLD;
|
||||
MXS_ERROR("MariaDB/MySQL version of server '%s' is less than 5.5, which is not supported. "
|
||||
"The server is ignored by the monitor. Server version: '%s'.", name(),
|
||||
srv->version_string);
|
||||
|
@ -123,7 +123,8 @@ public:
|
||||
typedef std::vector<SlaveStatus> SlaveStatusArray;
|
||||
enum class version
|
||||
{
|
||||
UNKNOWN, /* Anything older than 5.5. These are no longer supported by the monitor. */
|
||||
UNKNOWN, /* Totally unknown. Server has not been connected to yet. */
|
||||
OLD, /* Anything older than 5.5. These are no longer supported by the monitor. */
|
||||
MARIADB_MYSQL_55, /* MariaDB 5.5 series or MySQL 5.5 and later. Does not have gtid (on MariaDB) so
|
||||
* all gtid-related features (failover etc.) are disabled. */
|
||||
MARIADB_100, /* MariaDB 10.0 and greater. In practice though, 10.0.2 or greater is assumed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user