jmsadair / raft

An implementation of the Raft consensus protocol.
MIT License
31 stars 2 forks source link

Code quality and docs #84

Open bubbajoe opened 2 weeks ago

bubbajoe commented 2 weeks ago
jmsadair commented 2 weeks ago

Hi Joe,

I think your first three tasks are pretty reasonable. I've been meaning to improve the documentation for a while now, so I think this is a pretty good opportunity to do so. With that being said, I'm pretty busy this week, so it may take me a bit to get to it.

As for adding snapshot intervals, I'm curious what you had in mind? At present, the StateMachine interface has the NeedSnapshot function which should return true if a snapshot is necessary. This function is passed the size of the log in terms of log entries, which may be used to determine if a snapshot is needed. This function is called every time a log entry is applied to determine whether a snapshot is necessary. With most implementations, I think function should be very cheap to call.

bubbajoe commented 2 weeks ago

@jmsadair Thanks, and no rush!

And yea, thinking about it now. Snapshot Intervals aren't really needed, your implementation is more flexible.