Open sholsapp opened 8 years ago
So far we have (1) and (2) done. Working on (3) and (4) at the moment.
Next up we need the following methods implemented in the GallocyState
object.
bool majority_matches(int index)
- the leader needs this to determine when it is safe to set a commit and last applied index.void apply_command(int index)
- all servers need this so that a command can actually be applied to the state machine. In the leader, this is when a majority of server's match. In the client, this is when they discover the leader is ahead of them via a append_entry RPC. It would be a bonus if we had a place to apply the rules that apply to all servers in the same spot. This methods return type should probably be something meaningful. After this function returns, it's safe to respond to a user request.Additionally, all of the state logic presently in consensus/server.cpp and consensus/client.cpp should be moved into consensus/state.cpp. The client and server should focus on requesting/serving/serialization/deserialization.
The consensus module is the client/server that is responsible to making state changes to the global address space.
Three major tasks need to be done here:
Once done, we can progress onto writing relevant commands for the system (e.g., allocate memory, free memory, start thread, join thread, get owner, set owner).