Assign master status only to root level masters
If a relay master server is found in the replication tree, it should not get the master status. Previously all master servers were assigned the master status regardless of their depth in the replication tree. By comparing the depth value of each potential master, the monitor can find the right master at the root of the replication tree.
This commit is contained in:
@ -619,7 +619,7 @@ server_status(SERVER *server)
|
||||
{
|
||||
char *status = NULL;
|
||||
|
||||
if (NULL == server || (status = (char *)MXS_MALLOC(256)) == NULL)
|
||||
if (NULL == server || (status = (char *)MXS_MALLOC(512)) == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -632,6 +632,10 @@ server_status(SERVER *server)
|
||||
{
|
||||
strcat(status, "Master, ");
|
||||
}
|
||||
if (server->status & SERVER_RELAY_MASTER)
|
||||
{
|
||||
strcat(status, "Relay Master, ");
|
||||
}
|
||||
if (server->status & SERVER_SLAVE)
|
||||
{
|
||||
strcat(status, "Slave, ");
|
||||
|
Reference in New Issue
Block a user