You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have developed and key-value store with Bbolt. when testing, I noticed the previously applied commands get applied again after restart. I also tested this with the basic example in the repo. For an in-memory (volatile) key-value store this is fine. But for a persisted one this is creating duplicated values. I mean my raft commands are not idempotent so I want to make sure it only gets applied once.
Please, could you tell me how I do this?
Is there a way to tell to set the current node appliedIndex right after applying?
As I can see in the log, the apply index is always zero.
Note: I am just starting with a single node for now.
I have read this (#7), it's related but could not understand its relation to the snapshot
On a design note, how are you handling errors during apply?
My intuition was that the StateMache.Apply(data []byte) should return an error that informs the engine that we could not apply and therefore need to retry the same entry sequence. if no error appliedIndex gets updated forward.
I may be missing key understanding here, just trying to solidify my intuition around raft and this implementation. Thanks
The text was updated successfully, but these errors were encountered:
I have developed and key-value store with Bbolt. when testing, I noticed the previously applied commands get applied again after restart. I also tested this with the basic example in the repo. For an in-memory (volatile) key-value store this is fine. But for a persisted one this is creating duplicated values. I mean my raft commands are not idempotent so I want to make sure it only gets applied once.
Please, could you tell me how I do this?
Is there a way to tell to set the current node
appliedIndex
right after applying?As I can see in the log, the apply index is always zero.
Note: I am just starting with a single node for now.
I have read this (#7), it's related but could not understand its relation to the snapshot
On a design note, how are you handling errors during apply?
My intuition was that the
StateMache.Apply(data []byte)
should return an error that informs the engine that we could not apply and therefore need to retry the same entry sequence. if no error appliedIndex gets updated forward.I may be missing key understanding here, just trying to solidify my intuition around raft and this implementation. Thanks
The text was updated successfully, but these errors were encountered: