rcbops-cookbooks/mysql-openstack — pull request #68 by rackerjoe (2014-01-29 15:30:28+00:00)
Title: Rework slave config for first mysql master

There were instances where the first MySQL master would get its slave config
reset back to the initial configuration if the the chef runs and completed at
least once, replication were to break on the first master node, and then chef
were to run again. When broken replication would be reset to binlog 000001
and everything is broken horribly.

This was first reported by @JCallicoat in
https://github.com/rcbops/chef-cookbooks/issues/764.

This fix changes the checks for the first master to node to only change the
slave configuration setup when the slave is not running (i.e.
Slave_SQL_Running is not YES) AND the MAster_User is not repl. This is safe
as we hard code the repl username. If this changes in the future then we have
to change it here but that is in the future.