I am using heartbeat with MySQL master-master configuration, and using mon to check up on MySQL health. All works well for detecting downed host or broken MySQL. But the problems start after takeover, when replication collisions start piling up.
Is it possible to add a hook to heartbeat, to make it wait before taking over the IP address, by running an external script? I wrote one that checks up on replication, and exits with code 0 or 1 depending if all clear to proceed, and waits for replication to catch up completely to avoid collisions.
Maybe you can take a few ideas from how mysql-master-ha do something very similar?