Bug #70646 SHOW SLAVE HOSTS can display wrong Slave_UUID
Submitted: 17 Oct 2013 11:08 Modified: 25 Oct 2013 10:43
Reporter: NOT_FOUND NOT_FOUND Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.6.13, 5.6.14 OS:Any
Assigned to: CPU Architecture:Any

[17 Oct 2013 11:08] NOT_FOUND NOT_FOUND
Description:
The command "SHOW SLAVE HOSTS" can display a wrong Slave_UUID after a slave has disconnected.

How to repeat:
1. Start the master (server_id=10)
2. Start a first slave (server_id=11)
3. Execute "SHOW SLAVE HOSTS" on the master. I.E.:

+-----------+-------+------+-----------+--------------------------------------+
| Server_id | Host  | Port | Master_id | Slave_UUID                           |
+-----------+-------+------+-----------+--------------------------------------+
|        11 | flyos |    0 |        10 | 11111111-dd07-4109-bf79-925fdbc50000 |
+-----------+-------+------+-----------+--------------------------------------+

4. Stop the first slave. "SHOW SLAVE HOSTS" now display something like:

+-----------+-------+------+-----------+------------+
| Server_id | Host  | Port | Master_id | Slave_UUID |
+-----------+-------+------+-----------+------------+
|        11 | flyos |    0 |        10 |            |
+-----------+-------+------+-----------+------------+

5. Start a second slave (server_id=12)
6. Execute "SHOW SLAVE HOSTS" on the master. I.E.:

+-----------+-------+------+-----------+--------------------------------------+
| Server_id | Host  | Port | Master_id | Slave_UUID                           |
+-----------+-------+------+-----------+--------------------------------------+
|        11 | flyos |    0 |        10 | 00000000-dd07-4109-bf79-925fdbc50000 |
|        12 | flyos |    0 |        10 | 00000000-dd07-4109-bf79-925fdbc50000 |
+-----------+-------+------+-----------+--------------------------------------+

Note that the first and second slave are both displayed with the UUID of the second slave.

7. Stop the second slave
8. Start the first slave again.
9. Execute "SHOW SLAVE HOSTS" on the master. I.E:

+-----------+-------+------+-----------+--------------------------------------+
| Server_id | Host  | Port | Master_id | Slave_UUID                           |
+-----------+-------+------+-----------+--------------------------------------+
|        11 | flyos |    0 |        10 | 11111111-dd07-4109-bf79-925fdbc50000 |
|        12 | flyos |    0 |        10 | 11111111-dd07-4109-bf79-925fdbc50000 |
+-----------+-------+------+-----------+--------------------------------------+

Now both slaves are displayed with the UUID of the first slave.

Suggested fix:
rpl_master.cc: remove the THD in slave_list when a slave disconnects.
[25 Oct 2013 10:43] MySQL Verification Team
Hello!

Thank you for the bug report.

Thanks,
Umesh