Bug #81984 FABRIC Picks the wrong master and fails to failover
Submitted: 23 Jun 2016 9:21 Modified: 5 Jul 2016 12:44
Reporter: Philippe Florent Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Fabric Severity:S2 (Serious)
Version:1.5.6 OS:Debian (8.5)
Assigned to: CPU Architecture:Any
Tags: failover, master

[23 Jun 2016 9:21] Philippe Florent
Description:
Hello,

following this : https://dev.mysql.com/doc/mysql-utilities/1.5/en/fabric-quick-start-replication.html

I created one slave, one master, and replication is working between them

I install fabric on a separate box , create a group and add both machines to that group

- fabric set the primary on the slave instead of the master

- as I power off the slave(considered as master by fabric) to check the failover, the group health command hangs, and no failover ever seems to occur

How to repeat:
fabric set the primary on the slave instead of the master

mysqlfabric group lookup_servers my_group
Fabric UUID: 5ca1ab1e-a007-feed-f00d-cab3fe13249e
Time-To-Live: 1

server_uuid address status mode weight
------------------------------------ ------------- --------- ---------- ------
24e83dc5-3848-11e6-b605-0050569958d0 slave:3306 PRIMARY READ_WRITE 1.0
acb3a95e-3847-11e6-b25a-005056996666 master:3306 SECONDARY READ_ONLY 1.0

as I power off the slave(considered as master by fabric) to check the failover, the group health command hangs, and once I power back on the slave, I get this

mysqlfabric group health my_group

Fabric UUID: 5ca1ab1e-a007-feed-f00d-cab3fe13249e
Time-To-Live: 1

uuid is_alive status is_not_running is_not_configured io_not_running sql_not_running io_error sql_error
------------------------------------ -------- --------- -------------- ----------------- -------------- --------------- -------------------------------------------------------------------------------------- ---------
24e83dc5-3848-11e6-b605-0050569958d0 0 FAULTY 0 0 0 0 False False
acb3a95e-3847-11e6-b25a-005056996666 1 SECONDARY 0 0 1 0 error connecting to master 'fabric_server@slave:3306' - retry-time: 60 retries: 12 False
[1 Jul 2016 13:49] Philippe Florent
- I foudn out after reinstalling latest versions + new debian 2.5 that for some reason fabric is now setting 2 secondaries
and I found in the doc I could promote a server as primary

- for the connection error, I found out the fabric_server user had either wrong password or should have its host field set to '%' for the host in mysql user table

but yet, the documentation does not fit reality and the lack of tutorials is a pain in the a$$
[5 Jul 2016 12:44] Chiranjeevi Battula
Hello Philippe Florent,

Thank you for feedback

Thanks,
Chiranjeevi.