Closed Brokenice0415 closed 1 year ago
You can refer to the original Raft paper, section 8 Client interaction. To achieve linearizable read, you must always read the data from the leader. No need to append log for read, as described in the paper.
NuRaft provides an option to avoid overlapping time window between old leader and new leader, by having leadership expiration. That guarantees, if the current leader is alive and valid, its data is always fresh and there is no newer leader.
Hi @greensky00 , thanks for your explanation! I have read the section in detail and understood how nuraft ensures the linearizable read better!
Serving every read request as a write one is unacceptable for the cost.
Does nuraft offer any way to support linearizable read, like ReadIndex or LeaderLease?
I have seen a similar issue #288, but it seems that the linearizable read in this issue still needs to generate raft log entries of read requests.