MXS-1845 Only select a master if current master is no longer usable

The purpose is to make the selected master server sticky. The master is reselected only
if the current master is no longer a valid master.
This commit is contained in:
Esa Korhonen
2018-06-12 10:27:23 +03:00
parent 95935991ab
commit 2f987d0b10
6 changed files with 174 additions and 36 deletions

View File

@ -142,7 +142,7 @@ void MariaDBMonitor::Test::init_servers(int count)
base_server->name = MXS_STRDUP(server_name.str().c_str());
MXS_MONITORED_SERVER* mon_server = new MXS_MONITORED_SERVER; // Contents mostly undefined
mon_server->server = base_server;
MariaDBServer* new_server = new MariaDBServer(mon_server);
MariaDBServer* new_server = new MariaDBServer(mon_server, i - 1);
new_server->m_server_id = i;
m_monitor->m_servers.push_back(new_server);
m_monitor->m_server_info[mon_server] = new_server;