Trying to understand raft leader lease in etcd's implementation

136 views
Skip to first unread message

ericz

unread,
Sep 29, 2017, 2:57:04 AM9/29/17
to etcd-dev
Hello,

I am looking into the leader lease implementation etcd-raft libarary in order to provide linearizable read-only request. Got a few questions here and appreciate your comments:

1. There are two ReadOnlyOption: ReadOnlySafe and ReadOnlyLeaseBased. If I understand it correctly, the former requires an additional round of heartbeats for quorum acknowledgements. Whereas for the latter, the leader can serve reads immediately.  However, shouldn't the leader check the lease expiration time (i.e. ElectionElapsed < ElectionTimeout) before doing so? Otherwise how does it guard against it's superseded by a new leader?

2. It seems ticks (ElectionElapsed & ElectionTimeout) are used to determine whether a node is still holding a lease or not. However, does it subject to clock drift? I don't see where clock drift bound is included in etcd-raft's lease implementation, and wonder whether we can rely on ReadOnlyLeaseBased for linearizable read?

Thanks a lot!


Reply all
Reply to author
Forward
0 new messages