Skip to content

Feature: Implement LeaseGuard leader lease protocol #1651

@hadronzoo

Description

@hadronzoo

Add leader leases based on the LeaseGuard protocol (Davis et al., SIGMOD'26). This enables linearizable local reads without per-read network round trips by exploiting Raft's Leader Completeness guarantee.

Why

The current option for linearizable reads is expensive: the leader contacts a majority before each read, adding one RTT of latency to every read operation.

Leader leases allow the leader to serve reads locally while holding a valid lease. Prior lease protocols for Raft are poorly specified, entangle leases with elections, delay failover recovery, and have been buggy across implementations (etcd, HashiCorp Raft, Consul).

LeaseGuard solves these problems:

  1. The log is the lease: Committing a log entry grants the leader a lease. No separate lease-extension messages. This also solves the "faux leader" problem where a leader with disk failure keeps renewing its lease but can't make progress.

  2. Decoupled from elections: No changes to voting. A node bound by a lease can still become leader with a higher term.

  3. Formally specified: TLA+ spec available and model-checked for Read Your Writes and other correctness properties.

  4. Fast failover via two optimizations:

    • Deferred-commit writes: New leader accepts and replicates writes immediately, defers marking them committed until old lease expires. Prevents thundering herd.
    • Inherited lease reads: New leader identifies "limbo region" (entries that might not be committed) and serves reads immediately for keys unaffected by limbo entries. Requires synchronized clocks with known error bounds.

Changes

  • Add lease_duration configuration option
  • Track last_commit_time on leader (updated when entry commits)
  • Add lease validity check before serving local reads
  • On leader transition: infer prior leader's lease expiry from log, implement deferred-commit and inherited-lease-read logic
  • Optional: require bounded clock error for inherited lease reads optimization

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions