vmware-archive / haret

A strongly consistent distributed coordination system, built using proven protocols & implemented in Rust.
461 stars 18 forks source link

Move ClientRequest, Reconfiguration and ClientReply variants out of VrMsg #91

Closed andrewjstone closed 7 years ago

andrewjstone commented 7 years ago

A VR log should only contain ClientRequest and Reconfiguration variants. These should exist in their own enum, something like:

enum VrClientRequest {
    Op(ClientRequest),
    Reconfiguration(Reconfiguration)
}

VrClientReply should be it's own message separate from the VrMsg protocol message enum, which perhaps should be renamed to VrProtocol, and the new VrClientRequest enum.

Since they will still all likely need to be bundled into a single enum for usage in vr_fsm and vr_ctx, the new enum could look like this:

enum VrMsg {
    Protocol(VrProtocol),
    ClientReq(VrClientRequest),
    ClientRpy(VrCllientReply)
}

This of course will result in a bit of churn to the VR code, but it will be worth it for the added strong typing safety that will clarify functions and prevent the need to use unreachable!() like this.

This should be done after the fix to #90.

andrewjstone commented 7 years ago

Fixed by #126