Handling writes & consistent reads until leader lease expires

51 views Asked by At

The DynamoDB paper (https://www.usenix.org/system/files/atc22-elhemali.pdf) mentions that for replication they use Multi-Paxos, and leaders are assigned for a lease.

In case of leader failure,

The new leader won't serve any writes or consistent reads until the previous leader's lease expires

Let's say the leader was assigned at T1, with lease until T1 + 100.

At, T1 + 50; the replicas detect the leader is not responsive so go ahead with leader election; then how is serving the consistent reads and writes until T1 + 50 to T1 + 100?

2

There are 2 answers

2
Leeroy Hannigan On BEST ANSWER

From that time frame when a new leader is being elected, you are subject to either timeout exceptions or more likely InternalServerErrors which returns a 5XX to the client. Clients have built in backoff and retry which usually overcomes any leader election issues, so writes and strongly consistent reads will be eventually served, albeit with a higher latency.

0
hunterhacker On

You’ll get an internal server error response during that short time window for writes or strongly consistent reads targeting the partition that is electing a new leader. Reads and writes to other partitions will be unaffected.