Database / ValKey Interview questions
What happens when a primary node fails in a Valkey Cluster?
Other nodes gossip continuously over the cluster bus, and when enough of them stop getting timely responses from a given node, they first mark it PFAIL and then, once a quorum of primaries agrees, escalate it to FAIL.
Any replica of that failed primary starts a failover election, requesting votes from the other primaries in the cluster; the replica that gains a majority is promoted to own the affected hash slots and bumps the cluster's configuration epoch to make the change authoritative.
Clients that continue sending requests for those slots to the old node receive -MOVED redirects pointing them to the newly promoted primary.
More Related questions...