Hello,
Srinivas V <
sriniv...@gmail.com> writes:
> Hi All,
> I had a quick design question:
>
> Why did we decide to maintain commitIndex and lastAppliedIndex in volatile
> storage?
Because there's no need for commitIndex to be stored. In other words,
there's no loss of information if you don't store it.
> if we had maintained then in non volatile storage, we could have
> avoided re applying logs that have been applied before follower failures
> right?
If your FSM is memory-based (volatile), then you will have to re-apply
logs anyway, whether you store commitIndex or not.
If your FSM is disk-based, then yes, you normally need to persist
lastAppliedIndex indeed (but not necessarily commitIndex), to avoid
applying entries twice.
Cheers,
Free