Handling Failover In Replication