MasterFailover.pm

The main logic of failover.