diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index 8afc846150..371f7d2098 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -8014,7 +8014,7 @@ bool MySQL_Monitor::monitor_galera_process_ready_tasks(const std::vector> mmsds; - + std::set checked_servers; pthread_mutex_lock(&galera_mutex); assert(Galera_Hosts_resultset); mmsds.reserve(Galera_Hosts_resultset->rows_count); @@ -8022,6 +8022,11 @@ void MySQL_Monitor::monitor_galera_async() { for (std::vector::iterator it = Galera_Hosts_resultset->rows.begin(); it != Galera_Hosts_resultset->rows.end(); ++it) { const SQLite3_row* r = *it; + + auto ret = checked_servers.insert(std::string(r->fields[1]) + ":" + std::string(r->fields[2])); + if (ret.second == false) // duplicate server entry + continue; + bool rc_ping = server_responds_to_ping(r->fields[1], atoi(r->fields[2])); if (rc_ping) { // only if server is responding to pings