Closed shayanh closed 2 years ago
I agree that the persistence is required (according to Raft paper, in addition to log
, we should also persist currentTerm
and votedFor
). This PR is so large and I suggest working on persistence in another PR. And yes, your help is much appreciated. I should work on 538B presentation and the writing.
Also we can run etcd using tmpfs, so it uses memory as file system and there will no disk overhead. We can use this hack in case of need.
Re: tmpfs; I thought about it, but am not seriously considering it (yet). In case of need, yes.
I forgot one last comment: we should make sure the two TLA+ bugs are fixed in the interpreter as well, otherwise the fuzz tests will "find" the changes here eventually.
Otherwise, looks good.
Raft basic protocol implementation.
This PR contains:
mpcalctx.go
. Moved panic recovery beforectx.preRun()
to catchpreRun()
panics. The previous version panic recovered by a monitor and caused infinite blocking on a subsequentctx.Stop()
call.SubSeq
function iffrom
is greater thanto
, just return an empty sequence.