This fixes some bugs with the initial implementation of lease-based read-only operations and added support for linearizable read-only operations. The requirements for a lease-based read-only operation to be applied are now:
the leader lease is valid
the leader has committed a log entry for their term
the last applied index is at least as large as the read index associated with the operation
The requirements for a linearizable read-only operation are:
the leader has successfully sent heartbeats to a majority of the peers following the submission of the operation
the leader has committed a log entry for their term
the last applied index is at least as large as the read index associated with the operation
Linearizable read-only operations are batched - if their are read-only operations that are waiting for a round of heartbeats to be completed, the submitted operation will be queued up and applied with all the other pending operations. The tests for read-only operations are fairly light. My intention is to add more end-to-end test in the future (potentially with Jepsen).
This PR also includes a a fix for a bug that was discovered that allowed the logs of partitioned serves to diverge.
This fixes some bugs with the initial implementation of lease-based read-only operations and added support for linearizable read-only operations. The requirements for a lease-based read-only operation to be applied are now:
The requirements for a linearizable read-only operation are:
Linearizable read-only operations are batched - if their are read-only operations that are waiting for a round of heartbeats to be completed, the submitted operation will be queued up and applied with all the other pending operations. The tests for read-only operations are fairly light. My intention is to add more end-to-end test in the future (potentially with Jepsen).
This PR also includes a a fix for a bug that was discovered that allowed the logs of partitioned serves to diverge.