hashicorp/raft

how to make sure log entity has been commited then return client ?

Closed this issue · 1 comments

I see apply api to save log to logstore, but relplicateto. anthor is ansync.
how to make sure log entity has been commited then return client ?

raft.Apply returns an ApplyFuture object that you can use to wait until it's replicated. Calling applyFuture.Error() would block until log replication fail (e.g. leader transition failure), or until the log is fully replicated to a quorum of the servers and applied to the FSM of the leader and then future.Response would contain the FSM update result.

You can see a sample invocation in https://github.com/hashicorp/nomad/blob/v0.10.5/nomad/rpc.go#L729-L759 .