evanmcc / vrrm

rough code for running consensus
Apache License 2.0
18 stars 1 forks source link

replicated state machine improvements #3

Open evanmcc opened 7 years ago

evanmcc commented 7 years ago

similar to https://github.com/vmware/haret/issues/103, the replicated state machine should be able to tell the vrrm machinery not to add something to the log when it does not mutate the inner state.

evanmcc commented 7 years ago

another important thing to do here is to change the replicated behavior to get role information. i.e. whether or not it is the primary or a follower. we also need to decide whether or not a follower gets its number, or just the information that it is a follower.

We want to do this to guarantee e.g. that only one member can do a particular thing with a global side effect (check on another machine, write to a durable data store).

evanmcc commented 7 years ago

thirdly, it'd be nice to change the replicated state machine to something closer to gen_statem. The actions are nice, the singler event handler function is easier to support, and I'd like to be able to support internal actions so that we can pass internal operations back through the replicated machinery in and idiomatic way.

evanmcc commented 7 years ago

another thing that's required is to improve the consistency of state machine handling. there are at least 4 places where upcalls to the replicated state machine can happen, and they're poorly standardized. We need to update the client table on followers, and make sure that we gracefully handle a replicated state machine that returns {stop, Reason, Data} etc.