Advertisement
Intermediate Redis, Clustering

How does Redis Cluster automatically handle failover when a master node becomes unavailable?

Short answer

When enough nodes in the cluster agree that a specific master has become unreachable, one of that master's replicas is automatically promoted to become the new master, taking over responsibility for that master's hash slots, allowing the cluster to continue operating without…

Save Redis mock interview
Advertisement
AModel answer
When enough nodes in the cluster agree that a specific master has become unreachable, one of that master's replicas is automatically promoted to become the new master, taking over responsibility for that master's hash slots, allowing the cluster to continue operating without manual intervention.
Example

-- Failover happens automatically once a majority -- of master nodes agree the original master is down redis-cli cluster nodes

Real-world example
A retail company's Redis Cluster automatically promotes a replica to master status within seconds after the original master node crashes during a hardware failure, keeping their shopping cart service running with minimal disruption.
Likely follow-ups
  • How long does automatic failover typically take to complete?
  • What happens to write requests that were in progress during the failover?
Related topics