Failover delay and failback delay
Global Traffic Management properties with liveness tests have two settings: failback delay and failover delay. This section uses an example to show how failover and failback delay work together to switch the traffic between your primary and secondary data centers so that you can use these settings to meet your needs.
The property in this example is named property1 under the GTM domain example.com.akadns.net. It has a primary data center DC1.example.com and a secondary data center DC2.example.com.
As the primary data center, DC1.example.com is available at any time. If for some reason DC1 goes down, you will receive error messages. To fix this issue, move traffic from DC1 to another data center. If you are not using GTM, it might take an IT team at least 30 minutes to move the traffic from DC1. GTM can quickly move your traffic from DC1 to another data center if your property's failover and failback settings are set to zero.
In this example, the failover and failback settings are both 300s (5 minutes). If you have liveness tests, GTM detects the failure as soon as liveness tests start failing for DC1. GTM does an internal calculation of scores returned by liveness test. Depending on these scores GTM determines a cut-off score. If the aggregated score of liveness tests from all the GTM test agents is crossing this cut-off value, DC1 will be marked as down.
Because the failover delay in the example is set to 5 minutes, GTM will not mark DC1 as down immediately upon detecting this failure. GTM will schedule a time (a 5-minute failover delay time) in the future to mark DC1 as down. After 5 minutes, GTM will again evaluate the score to see if the situation has changed or not. If it has not, DC1 will be marked as down and all the traffic will be moved to the secondary data center.
Failback delay works in the manner but in reverse. The traffic is now on the secondary data center. For example, DC1 went down due to a power outage. You switched to backup power and manually checked that DC1 is functioning again. When a liveness test starts returning successful responses, the liveness score will improve and fall below the cut-off score. The moment the liveness test falls below the cut-off score, GTM will schedule a time (5 minutes in the future) to mark DC1 as up. After 5 minutes, GTM will verify if the situation sustained or not. If yes, DC1 will be marked as up and all traffic will go back to DC1.