Skip to main content

Leader Lease

Objective

To introduce the Leader Lease Read feature into Ratis to enhance read capabilities and address existing limitations.

Current Implementation Limitations

  1. Leader Bypass Read: Offers improved latency and throughput but is constrained to the leader and may produce inconsistent results.
  2. Server Linearizable Read (ReadIndex): Allows clients to read from any server, ensuring linearizability but suffers from suboptimal latency (20-30% throughput drop compared to bypass read).

Reasons for Proposed Feature (Leader Lease Read)

  • Validated by other communities (e.g., Sofa-Jraft), resulting in a 15% improvement in throughput performance.
  • Addresses the demand for low-latency read capabilities from downstream dependents like IoTDB for time-series queries.

Configuration

To enable and configure Leader Lease, the following properties can be set in RaftServerConfigKeys:

PropertyDescriptionTypeDefault
raft.server.read.leader.lease.enabledWhether to enable lease in linearizable read-only requests.booleanfalse
raft.server.read.leader.lease.timeout.ratioMaximum timeout ratio of leader lease.double (ranging from 0.0 to 1.0)0.9