Bug #26189 Replication Status shows wrong clients if you use a replication chain
Submitted: 8 Feb 2007 17:04 Modified: 20 Feb 2007 14:48
Reporter: Jens Schanz Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.2.8 OS:Linux (OpenSuse 10.2)
Assigned to: CPU Architecture:Any

[8 Feb 2007 17:04] Jens Schanz
Description:
If you use the "Replication Status"-Tab in a mulit-master-slave environment, on both slaves the wrong client will be shown:

e.g.

[server1;master] ---> [server2;slave...server2;master] ---> [server3;slave]

Have a look on server1 in the "replication status"
  --> server1 MASTER
  --> server2 SLAVE

Now look at server2
  --> server2 MASTER
  --> server3 SLAVE
  --> server2 SLAVE (this happens if report-host in my.cnf is set for this server)

Have a look at server3
  --> server3 MASTER
  --> server2 SLAVE
  --> server3 SLAVE (that seems the same problem as above)

but why is server2 shown here as slave?

How to repeat:
build the following environment:

[server1;master] ---> [server2;slave...server2;master] ---> [server3;slave]

replicate a database from server1 to server3 over server2

set on all hosts the report-host flag to it's host name

Suggested fix:
suppress connections from the same host. in this case we may lost self-replication (replication on the same host from database1 into database2). but maybee someone has a better idea
[20 Feb 2007 13:35] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Please read about how replication status works at http://dev.mysql.com/doc/refman/5.0/en/show-slave-hosts.html
[20 Feb 2007 14:48] Jens Schanz
Ok, maybee this is a discussion for the replication group.
I think it's a little bit strange, that host C knows the slave from host A.
Although it's strange, that on host B both slaves will be shown. On master id 297 theres is only one slave (296) connected, but both (server id 296 and 297) will be displayed as slave connected.

Host A (Master for host B):
mysql> show slave hosts;
+-----------+------------------------+------+-------------------+-----------+
| Server_id | Host                   | Port | Rpl_recovery_rank | Master_id |
+-----------+------------------------+------+-------------------+-----------+
| 297       | aaa.bbb.de             | 3306 | 0                 | 1         |
+-----------+------------------------+------+-------------------+-----------+
1 row in set (0.05 sec)

Host B (Slave for host A / Master for host C):
mysql> show slave hosts;
+-----------+------------------------+------+-------------------+-----------+
| Server_id | Host                   | Port | Rpl_recovery_rank | Master_id |
+-----------+------------------------+------+-------------------+-----------+
|       296 | xxx.yyy.de             | 3306 |                 0 |       297 |
|       297 | aaa.bbb.de             | 3306 |                 0 |         1 |
+-----------+------------------------+------+-------------------+-----------+
2 rows in set (0.00 sec)

Host C (Slave for host B):
mysql> show slave hosts;
+-----------+------------------------+------+-------------------+-----------+
| Server_id | Host                   | Port | Rpl_recovery_rank | Master_id |
+-----------+------------------------+------+-------------------+-----------+
|       297 | aaa.bbb.de             | 3306 |                 0 |         1 |
|       296 | xxx.yyy.de             | 3306 |                 0 |       297 |
+-----------+------------------------+------+-------------------+-----------+
2 rows in set (0.00 sec)