First, turn the 11 comment: Copy the state machine schema. The consistency algorithm manages log replication to include state machine commands from a short receive. The state machine processes the commands in the same sequence in the log, so they produce the same output.
A formal illustration, first Figure 1 is divided into 2 parts, client and server. Arrow 1 The client points to the server's consistency module, which indicates that the client sends the request to the server received by the consistency module, and then the arrow 2 for the Distribution Log Processing command. you can see that arrow 2 points to a multi-layered log module, which indicates that multiple servers have received this information. After the log processing is complete, an arrow 3 appears, the log module sends a message to the state machine, and finally the state machine returns the result to the client. This paper mainly describes the implementation of the state machine.
Again because the figure 2 is too large, I have done a manual slicing, and Figure 2 is also the basis of raft communication, a total of 4 types of information. For example, 2-1, this describes several status message components of raft.
Persistent state in all Server: Update stale information before responding to RPC. This information includes Currentterm, votefor, and log[]3 sections.
Consistency Algorithm Quest (Extended Version) diagram