Added master_host update in the loop
Added master_host update in the loop, returns the right server in case of multiple servers with same replication depth
This commit is contained in:
parent
c14700fcff
commit
2eafe15bca
@ -348,8 +348,10 @@ BACKEND *master_host = NULL;
|
||||
int found = 0;
|
||||
for (i = 0; inst->servers[i]; i++) {
|
||||
if (inst->servers[i] && SERVER_IS_RUNNING(inst->servers[i]->server) && (inst->servers[i]->server->depth == master_host->server->depth)) {
|
||||
if (inst->servers[i]->server->status & SERVER_MASTER)
|
||||
if (inst->servers[i]->server->status & SERVER_MASTER) {
|
||||
master_host = inst->servers[i];
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
|
Loading…
x
Reference in New Issue
Block a user