Question about commiting a raft entry/executing that entry's command by the FSM

31 views
Skip to first unread message

Ivan Pim

unread,
May 4, 2017, 10:26:52 AM5/4/17
to raft-dev
Hello,

I'm a bit confused about the machinery/technical side of the commitment procedure.

So, let's say a raft cluster consisting of 5 members is operating fine and no servers crash/fail/lose network connectivity and so on.

Let's say S1(server 1) is the leader. S2,S3 and S4 are followers.

S1 receives a new client request. Then S1 sends an AppendRPC request to S2, S3 and S4 containing the client command, the term and the index.
S2, S3, S4 verify this AppendRPC request that came from the leader by means of log matching.
The logs of S2, S3, S4 are up-to-date and they all accept this AppendRPC request.

My question is, at this point S2,S3 and S4 store the new entry in their raft log, but it's not considered commited yet, right?
After storing the new entry in their respective logs S2, S3 and S4 reply with an OK, accepted command, its term and index to S1 (the leader)

Question is, when does the leader and S2,S3 and S4 apply the command to their Finite State Machine (not their log)?
Does the leader send another acknowledgment request after receiving an AppendRPC response from the majority of the followers?
And the followers apply the log entry upon receiving this acknowledgment request?

And the question that follows after this question - when is it safe for the leader to reply to the client, that the request has been serviced?

Thank you!

Oren Eini (Ayende Rahien)

unread,
May 4, 2017, 11:02:10 AM5/4/17
to raft...@googlegroups.com
At the moment that S2 & S3 got the entry and wrote it to their logs, the entry is committed as far as Raft is concerned.
But no one yet knows about it (including the leader).
When the leader get enough confirmations to see that it reached the majority, it will apply that to the FSM. 
And when it will next send heartbeat to the other members, it will let them know up to what point in the log it is safe to apply to the FSM

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages