Bug #72281 mysqlfabric group promote may break replication
Submitted: 9 Apr 2014 0:02 Modified: 14 Apr 2014 7:48
Reporter: Fernando Ipar (OCA) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Fabric Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[9 Apr 2014 0:02] Fernando Ipar
Description:
The documentation indicates that a 'fabric'@'localhost' account must be created on nodes that will be managed by fabric: http://dev.mysql.com/doc/mysql-utilities/1.4/en/fabric-create-user.html

However, while following the examples from http://dev.mysql.com/doc/mysql-utilities/1.4/en/fabric-quick-start-replication.html , replication breaks on the nodes after running 'mysqlfabric group promote <groupname>' with this error: 

                   Last_Error: Error 'Operation CREATE USER failed for 'fabric'@'localhost'' on query. Default database: 'mysql'. Query: 'CREATE USER 'fabric'@
'localhost' IDENTIFIED BY PASSWORD '*CB4AFD4AA6D15B1B4B2F249F7386275638D906B8''

I eventually realized that this was due to the 'CREATE USER' statement being written to the binlogs on each node, therefore when group promote is run, and replication is set up, the statement is replayed from the chosen mater to the replica(s) (two replicas in my case as I'm following the examples as close as possible). 

If I set @@session.sql_log_bin=0 before creating the users, then the problem does not happen, and group promote works as expected

How to repeat:
Follow the steps as indicated in the links provided in the Description.  

Suggested fix:
I'm not sure, perhaps it is enough to point in the documentation that while the 'fabric' user must exist on all nodes for mysqlfabric to be able to manage them, they should be created without writing that to the binlog?
[9 Apr 2014 0:06] Fernando Ipar
I should add that the instructions from the documentation are followed on a cleanly installed set of servers every time. Between each test, each instance has it's datadir wiped out and regenerated by mysql_install_db.
[14 Apr 2014 7:48] Mats Kindahl
Thank you for the bug report. Verified as described.

It is indeed true that if replication is enabled and commands like CREATE USER is executed on the master, they are replicated. I think the documentation should be updated to clarify what happens, but I also think it is important to make the system handle these kinds of situations gracefully.
[6 Jul 2017 19:19] Bugs System
Status updated to 'Won't fix' (Fabric is now covered under Oracle Lifetime Sustaining Support)