hashicorp/raft

Question regarding replay

Closed this issue · 0 comments

Hi,

I have a certain use case I'm having a hard time with.

I replicate state in my service using raft and store that state in a DB. Now lets say a node goes down and an update is made to one of the entries then the node comes back up and then tries to restore it's state from the database it always ends up restoring old state because I can't figure out how to wait for the replay to complete before I re-load my state.

Apply gets called multiple times then once more after which contains the update so my question is how do you wait for the the sync to complete before doing something else? Do I have to orchestrate all of this from the leader seeing as the leader is the only one that can use barrier or is there some other way to wait for the indexes to catch up to other nodes before continuing?

Thanks