Failover testing
Failover testing is deliberately failing a component of a running system, such as a server, a database or a network link, to check that a standby takes over. It measures how long the switch takes, what work or data is lost on the way, and whether the system can later return to its normal arrangement.
The longer version
Redundancy is a claim until it has been exercised. A system drawn with two of everything has a second database, a second server and a second route, and failover is the moment the second one is asked to do the first one's job. The ISTQB glossary defines failover as the backup operational mode in which the functions of a system that becomes unavailable are assumed by a secondary system. A failover test produces that moment on purpose. The tester stops the primary, or cuts it off from the network, while realistic traffic is running, and then observes four things: whether the failure was detected, whether the standby took over without anyone stepping in, how long users were turned away, and what happened to the work in progress when the primary went. Until that has been done, the standby has been tested only as a diagram.
Two kinds of switch are tested, and they are not equally hard. A planned failover, often called a switchover, is the one an operator starts for maintenance: writes are paused, the standby catches up, the roles are exchanged, and nothing should be lost. An unplanned failover has no such preparation. The primary disappears in the middle of a transaction, and the standby holds only what had been copied to it by then. If copying lags by a few seconds, those seconds of orders or messages are gone, and the test's job is to find out how much was lost and whether anyone would know. Results are set against two targets agreed beforehand. The NIST glossary defines the recovery time objective as the overall length of time a system's components can be in the recovery phase before the organisation's mission is harmed, and the recovery point objective as the point in time to which data must be recovered after an outage. One caps the interruption and the other caps the data lost. The awkward cases deserve runs of their own: a primary that is slow and not dead, a network split in which each side believes the other has failed and both accept writes, and a failure during the busiest hour.
Failback is the return journey, and it is tested separately. Once the original primary is repaired it has to rejoin as a standby, receive everything written while it was away, and at some point take its role back, which is a second switch with its own interruption. A team that rehearses only the outward half ends an incident running on one machine with no spare. Three neighbouring practices are easy to confuse with this one. A rollback plan returns a release to the previous version of the software after a bad change, while failover keeps the same version running on other hardware. Load testing asks whether the system copes with expected demand, and the two meet in one question: whether the surviving half can carry the full load alone. Operational acceptance testing counts recovery from failure among the things operations staff must see work before they accept a system. On managed hosting the provider performs the switch, and the test is still worth running, since the application's own behaviour is the part the provider does not vouch for: whether its connections are re-established, whether queued jobs resume, and whether a user half-way through a form can finish it.
How the failure is produced decides what the test proves. The gentlest method is the switch the platform itself offers: Alteryx's high-availability guide moves a clustered role to another node through the cluster manager, and then repeats the test by shutting down the owning virtual machine and by cutting power to a physical server. Killing a process or pulling a network link without warning is closer to a real fault. Many disaster recovery products also offer a test failover, a drill that starts copies of the protected machines from replicated data. Microsoft's Azure Site Recovery documentation says such a test runs without any data loss or downtime and does not affect ongoing replication or the production environment, and it recommends a network isolated from production for it. A drill of that kind proves that the replicas start and the data is usable, and it leaves the switch of live traffic untested. The arrangement matters as well. In an active-passive pair the standby waits idle, so the test checks the takeover. In an active-active pair every node already serves traffic, so the test checks that the survivors absorb the share of the one removed.
Common questions
What is failover testing?
Failover testing is a test in which a working component is deliberately taken out of service to confirm that a standby assumes its role. The tester stops or isolates a server, a database or a network link while the system is in use, then records whether the switch happened unaided, how long it took and whether any data or work in progress was lost.
What is the difference between failover and failback?
Failover is the switch from a failed primary to its standby. Failback is the later return to the original arrangement, once the failed component has been repaired and has caught up with everything written in its absence. Each is a separate change of roles with its own interruption and its own risk of lost or duplicated data, so each needs its own test.
What does a failover test measure?
A failover test measures the time from the failure to its detection, the time from detection to the standby serving requests, the number of requests that failed in between, and the amount of data written to the primary that never reached the standby. The first two together are compared with the recovery time objective and the last with the recovery point objective.
What is the difference between failover testing and disaster recovery testing?
Failover testing covers the loss of one component whose standby is already running, and the switch is expected to be automatic and brief. Disaster recovery testing covers a loss that no running standby absorbs, such as a whole site or region, where service is rebuilt elsewhere from replicas and backups by people following a documented procedure. The first is a mechanism to be triggered and timed, and the second is a plan to be rehearsed.
What is a test failover?
A test failover is a rehearsal offered by disaster recovery tools: copies of the protected machines are started from replicated data, usually on a network isolated from production, checked and then deleted. Microsoft describes its Azure Site Recovery version as a disaster recovery drill that runs without data loss or downtime and does not affect ongoing replication. The live switch of traffic is the part it does not exercise.
How do you test a disaster recovery plan?
Disaster recovery plans are tested in rising levels of disruption. Scality's glossary lists five: a review of the plan against the current environment, a tabletop exercise in which the team talks through a scenario, a component test restoring one system, a parallel test recovering systems at the alternate site while production runs, and a full interruption that moves production there. In its words, cost and disruption rise down the table, and so does the number of problems found.
Is failover the same as rolling back a release?
Failover and rollback respond to different faults. Failover moves the same version of the software onto standby infrastructure after hardware, a network or a data centre fails. A rollback returns to the previous version of the software after a release proves faulty, on infrastructure that is working normally. Failing over does nothing for a bad release, since the standby runs the same faulty code.
Bug reports that arrive ready to triage.
Collect replay, console, network and browser context with the Free plan.