Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fate ¶
type Fate int
px.Status() return values, indicating whether an agreement has been decided, or Paxos has not yet reached agreement, or it was agreed but forgotten (i.e. < Min()).
type Paxos ¶
type Paxos struct {
// contains filtered or unexported fields
}
func Make ¶
the application wants to create a paxos peer. the ports of all the paxos peers (including this one) are in peers[]. this servers port is peers[me].
func (*Paxos) Done ¶
the application on this machine is done with all instances <= seq.
see the comments for Min() for more explanation.
func (*Paxos) Kill ¶
func (px *Paxos) Kill()
tell the peer to shut itself down. for testing. please do not change these two functions.
func (*Paxos) Min ¶
Min() should return one more than the minimum among z_i, where z_i is the highest number ever passed to Done() on peer i. A peers z_i is -1 if it has never called Done().
Paxos is required to have forgotten all information about any instances it knows that are < Min(). The point is to free up memory in long-running Paxos-based servers.
Paxos peers need to exchange their highest Done() arguments in order to implement Min(). These exchanges can be piggybacked on ordinary Paxos agreement protocol messages, so it is OK if one peers Min does not reflect another Peers Done() until after the next instance is agreed to.
The fact that Min() is defined as a minimum over *all* Paxos peers means that Min() cannot increase until all peers have been heard from. So if a peer is dead or unreachable, other peers Min()s will not increase even if all reachable peers call Done. The reason for this is that when the unreachable peer comes back to life, it will need to catch up on instances that it missed -- the other peers therefor cannot forget these instances.