willemt / raft

C implementation of the Raft Consensus protocol, BSD licensed
Other
1.13k stars 271 forks source link

Meaning of entry_idx in log_offer #92

Closed anujkaliaiitd closed 6 years ago

anujkaliaiitd commented 6 years ago

I was assuming that the log_offer callback always appends to the log. However, the callback has an entry_idx parameter. Does this mean that log_offer might require overwriting an old entry in the log, and writing beyond the current head of the log?

On a related note: are the newest/oldest log entries for log_pop/log_poll determined by entry_idx, or the order in which log_offer is called for entries?