Function compartmentalized_paxos_core

Source
pub unsafe fn compartmentalized_paxos_core<'a, P: PaxosPayload>(
    proposers: &Cluster<'a, Proposer>,
    proxy_leaders: &Cluster<'a, ProxyLeader>,
    acceptors: &Cluster<'a, Acceptor>,
    a_checkpoint: Optional<usize, Cluster<'a, Acceptor>, Unbounded>,
    c_to_proposers: impl FnOnce(Stream<Ballot, Cluster<'a, Proposer>, Unbounded>) -> Stream<P, Cluster<'a, Proposer>, Unbounded>,
    config: CompartmentalizedPaxosConfig,
) -> (Stream<Ballot, Cluster<'a, Proposer>, Unbounded>, Stream<(usize, Option<P>), Cluster<'a, ProxyLeader>, Unbounded, NoOrder>)
Expand description

Implements the Compartmentalized Paxos algorithm as described in “Scaling Replicated State Machines with Compartmentalization”, which augments regular Paxos with a cluster of Proxy Leaders.

Proposers that wish to broadcast p2as to acceptors or collect p2bs from acceptors instead go through the Proxy Leaders, which offload networking. The slot is used to determine which Proxy Leader to offload to. Acceptors are arranged into a grid, where each row and column must have at least f+1 members. Rows represent “write quorums”; an entire row of acceptors must confirm a payload before it is committed. Columns represent “read quorums”; an entire column of acceptors must respond to a p1b before a proposer is elected the leader. Read and write quorums were introduced in “Flexible Paxos: Quorum Intersection Revisited”.

Returns a stream of ballots, where new values are emitted when a new leader is elected, and a stream of sequenced payloads with an index and optional payload (in the case of holes in the log).

§Safety

When the leader is stable, the algorithm will commit incoming payloads to the leader in deterministic order. However, when the leader is changing, payloads may be non-deterministically dropped. The stream of ballots is also non-deterministic because leaders are elected in a non-deterministic process.