Allow only galera servers in online status

pull/5106/head
Juan Manuel Fernández García-Minguillán 9 months ago
parent afb1865107
commit a06c8fa8a7

@ -5410,20 +5410,12 @@ void MySQL_HostGroups_Manager::update_galera_set_writer(char *_hostname, int _po
}
pthread_mutex_unlock(&Galera_Info_mutex);
if (resultset->rows_count) {
for (std::vector<SQLite3_row *>::iterator it = resultset->rows.begin() ; it != resultset->rows.end(); ++it) {
SQLite3_row *r=*it;
int hostgroup=atoi(r->fields[0]);
if (hostgroup==_writer_hostgroup) {
int status=atoi(r->fields[1]);
if (status==0)
found_writer=true;
}
if (read_HG>=0) {
if (hostgroup==read_HG) {
found_reader=true;
}
}
for (size_t i = 0, l = resultset->rows.size(); i < l; ++i) {
int status = atoi(resultset->rows[i]->fields[1]);
if (status == 0) {
int hostgroup = atoi(resultset->rows[i]->fields[0]);
found_writer |= hostgroup == _writer_hostgroup;
found_reader |= (read_HG >= 0) && (hostgroup == read_HG);
}
}

Loading…
Cancel
Save