Database / Google Spanner Database Interview questions
What happens when a leader region becomes unavailable in Spanner?
In a multi-region configuration, each split's Paxos group has replicas spread across the configured regions, with the leader typically hosted in the designated "leader region" for low write latency. If that region becomes unavailable, whether from a network partition or an outage, the affected Paxos groups detect the loss of the current leader once its lease expires and run a new leader election among the surviving replicas in the other regions.
Because commits only require a majority quorum, not the original leader region specifically, a multi-region configuration (typically using a 2-2-1-region-style replica layout) can still form a majority from the remaining regions and continue accepting writes, just with higher latency until the new leader is elected and located farther from application traffic that was tuned for the old leader region. Reads against read-only replicas in unaffected regions are largely unaffected throughout, which is why multi-region configurations carry a 99.999% availability SLA: the system is designed to survive a full regional outage without becoming unavailable, at the cost of temporarily elevated write latency during the transition.
More Related questions...